using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace YulgangMarkup
{
	public class frmYBI : Form
	{
		private int AbilityGlobalPosition = Config.AbilityStartPosition;

		private int AbilityTempIndex = -1;

		private int BadGlobalPosition = Config.BadwordStartPosition;

		private int BadTempIndex = -1;

		private Button btn_AddNPC;

		private Button btn_delLastItem;

		private Button btn_delNPC;

		private Button btn_EnableNPCID;

		private Button btnCopy;

		private Button btnCopyBrowse;

		private Button btnItemSearch;

		private Button btnSaveAbility;

		private Button btnSaveBadWord;

		private Button btnSaveItem;

		private Button btnSaveMap;

		private Button btnSaveNPC;

		private Button btnSaveSkill;

		private Button btnSaveSpeech;

		private Button btnSearchAbility;

		private Button btnSearchNPC;

		private Button btnSkillSearch;

		private Button button1;

		private Button button2;

		private Button button3;

		private static byte[] CipherKey;

		private ComboBox cmbAbility;

		private ComboBox cmbItem;

		private ComboBox cmbNPCType;

		private ComboBox cmbSkill;

		private ComboBox cmbSpeech;

		private IContainer components = null;

		private ToolStripMenuItem extendItemsToolStripMenuItem;

		private ToolStripMenuItem fToolStripMenuItem;

		private int ItemGlobalPosition = Config.ItemStartPosition;

		private int itemPosition = 0;

		private int ItemTempIndex = -1;

		private Label label1;

		private Label label10;

		private Label label11;

		private Label label12;

		private Label label14;

		private Label label15;

		private Label label16;

		private Label label17;

		private Label label18;

		private Label label19;

		private Label label2;

		private Label label20;

		private Label label21;

		private Label label22;

		private Label label23;

		private Label label24;

		private Label label25;

		private Label label26;

		private Label label27;

		private Label label28;

		private Label label29;

		private Label label3;

		private Label label30;

		private Label label31;

		private Label label32;

		private Label label33;

		private Label label34;

		private Label label35;

		private Label label36;

		private Label label37;

		private Label label38;

		private Label label39;

		private Label label4;

		private Label label40;

		private Label label41;

		private Label label42;

		private Label label43;

		private Label label5;

		private Label label6;

		private Label label7;

		private Label label8;

		private Label label9;

		private ToolStripMenuItem loadToolStripMenuItem;

		private ToolStripMenuItem loadToolStripMenuItem1;

		private ListBox lstAbility;

		private ListBox lstBadWords;

		private ListBox lstItem;

		private ListBox lstMap;

		private ListBox lstNPC;

		private ListBox lstSkill;

		private ListBox lstSpeech;

		private int MapGlobalPosition = Config.MapStartPosition;

		private int MapTempIndex = -1;

		private MenuStrip menuStrip1;

		private int NPCGlobalPosition = Config.NPCStartPosition;

		private int npcPostion = 0;

		private int NPCTempIndex = -1;

		private ToolStripMenuItem saveToolStripMenuItem;

		private ToolStripMenuItem saveToolStripMenuItem1;

		private int SkillGlobalPosition = Config.SkillStartPosition;

		private int SkillTempIndex = -1;

		private byte[] speechData;

		private int SpeechGlobalPosition = Config.SpeechStartPosition;

		private ToolStripMenuItem speechInfoEditorToolStripMenuItem;

		private int SpeechTempIndex = -1;

		private TabControl tabControl1;

		private TabPage tabPage1;

		private TabPage tabPage2;

		private TabPage tabPage3;

		private TabPage tabPage4;

		private TabPage tabPage5;

		private TabPage tabPage6;

		private TabPage tabPage7;

		private TabPage tabPage8;

		private TextBox textBox1;

		private TextBox textBox10;

		private TextBox textBox11;

		private TextBox textBox12;

		private TextBox textBox13;

		private TextBox textBox14;

		private TextBox textBox15;

		private TextBox textBox2;

		private TextBox textBox3;

		private TextBox textBox4;

		private TextBox textBox5;

		private TextBox textBox6;

		private TextBox textBox7;

		private TextBox textBox8;

		private TextBox textBox9;

		private TextBox txtAbilityDesc;

		private TextBox txtAbilityDesc2;

		private TextBox txtAbilityID;

		private TextBox txtAbilityName;

		private TextBox txtAbilitySearch;

		private TextBox txtBadWord;

		private TextBox txtBadWordID;

		private TextBox txtCopyPath;

		private TextBox txtItemDesc;

		private TextBox txtItemID;

		private TextBox txtItemName;

		private TextBox txtItemSearch;

		private TextBox txtMapID;

		private TextBox txtMapName;

		private TextBox txtNPCDesc;

		private TextBox txtNPCID;

		private TextBox txtNPCName;

		private TextBox txtNPCSearch;

		private TextBox txtSkillDesc;

		private TextBox txtSkillID;

		private TextBox txtSkillName;

		private TextBox txtSkillSearch;

		private TextBox txtSpeechDesc;

		private TextBox txtSpeechID;

		private TextBox txtSpeechNPCID;

		private TextBox txtSpeechSearch;

		private byte[] YBI_Data;

		private ToolStripMenuItem yBIEditorToolStripMenuItem;

		private ToolStripMenuItem 导入YBI新怪物ToolStripMenuItem;

		public static int ItemStart;

		public static int ItemJump;

		public static int ItemNameSpacing;

		public static int I;

		public static int ItemDescSpacing;

		public static int NPCStartPosition;

		public static int NPCJumpValue;

		public static int NPCNameSpacing;

		public static int NPCDescSpacing;

		public static int AbilityStartPosition;

		public static int AbilityJumpValue;

		public static int AbilityNameSpacing;

		public static int AbilityDescONESpacing;

		public static int AbilityDescTWOSpacing;

		public static int MapStartPosition;

		public static int MapJumpValue;

		public static int MapNameSpacing;

		public static int SkillStartPosition;

		public static int SkillJumpOne;

		public static int SkillJumpTwo;

		public static int SkillJumpThr;

		public static int SkillNameSpacing;

		public static int SkillDescSpacing;

		public static int BadwordStartPosition;

		public static int BadwordJumpValue;

		public static int SpeechStartPosition;

		public static int SpeechJumpValue;

		public static int SpeechTextSpacing;

		static frmYBI()
		{
			CipherKey = new byte[64]
			{
				18,
				29,
				7,
				25,
				15,
				31,
				22,
				27,
				9,
				26,
				3,
				13,
				19,
				14,
				20,
				11,
				5,
				2,
				23,
				16,
				10,
				24,
				28,
				17,
				6,
				30,
				0,
				21,
				12,
				8,
				4,
				1,
				26,
				31,
				17,
				10,
				30,
				16,
				24,
				2,
				29,
				8,
				20,
				15,
				28,
				11,
				13,
				4,
				19,
				23,
				0,
				12,
				14,
				27,
				6,
				18,
				21,
				3,
				9,
				7,
				22,
				1,
				25,
				5
			};
			ItemStart = 8;
			ItemJump = 464;
			ItemNameSpacing = 4;
			ItemDescSpacing = 112;
			NPCStartPosition = 9974524;
			NPCJumpValue = 7860;
			NPCNameSpacing = 4;
			NPCDescSpacing = 76;
			AbilityStartPosition = 8142920;
			AbilityJumpValue = 1388;
			AbilityNameSpacing = 4;
			AbilityDescONESpacing = 108;
			AbilityDescTWOSpacing = 1132;
			MapStartPosition = 27120808;
			MapJumpValue = 100;
			MapNameSpacing = 4;
			SkillStartPosition = 1900616;
			SkillJumpOne = 6096;
			SkillJumpTwo = 336;
			SkillJumpThr = 360;
			SkillNameSpacing = 4;
			SkillDescSpacing = 96;
			BadwordStartPosition = 9573448;
			BadwordJumpValue = 64;
			SpeechStartPosition = 16092;
			SpeechJumpValue = 148;
			SpeechTextSpacing = 20;
		}

		public frmYBI()
		{
			InitializeComponent();
		}

		private void btn_AddNPC_Click(object sender, EventArgs e)
		{
			byte[] array = stringToByte(txtNPCID.Text, 32);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(txtNPCID.Text)), 0, YBI_Data, npcPostion, BitConverter.GetBytes(int.Parse(txtNPCID.Text)).Length);
			byte[] array2 = stringToByte(txtNPCName.Text, 32);
			Buffer.BlockCopy(array2, 0, YBI_Data, npcPostion + Config.NPCNameSpacing, array2.Length);
			byte[] array3 = stringToByte(txtNPCDesc.Text, 400);
			Buffer.BlockCopy(array3, 0, YBI_Data, npcPostion + Config.NPCDescSpacing, array3.Length);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox8.Text)), 0, YBI_Data, npcPostion + 70, 2);
			ReloadNPC();
			lstNPC.SetSelected(lstNPC.Items.Count - 1, value: true);
			txtNPCID.ReadOnly = true;
			MessageBox.Show("新增成功，若需修改请在菜单栏中保存YBI后再进行修改！");
		}

		private void btn_delLastItem_Click(object sender, EventArgs e)
		{
			lstItem.SetSelected(lstItem.Items.Count - 1, value: true);
			byte[] array = new byte[Config.ItemJumpValue];
			Buffer.BlockCopy(array, 0, YBI_Data, itemPosition - Config.ItemJumpValue, array.Length);
			ReloadItems();
			lstItem.SetSelected(lstItem.Items.Count - 1, value: true);
		}

		private void btn_delNPC_Click(object sender, EventArgs e)
		{
			lstNPC.SetSelected(lstNPC.Items.Count - 1, value: true);
			byte[] array = new byte[Config.NPCJumpValue];
			Buffer.BlockCopy(array, 0, YBI_Data, npcPostion - Config.NPCJumpValue, array.Length);
			ReloadNPC();
			lstItem.SetSelected(lstNPC.Items.Count - 1, value: true);
		}

		private void btn_EnableNPCID_Click(object sender, EventArgs e)
		{
			txtNPCID.Enabled = true;
			txtNPCID.ReadOnly = false;
		}

		private void btnCopy_Click(object sender, EventArgs e)
		{
			if (!(txtCopyPath.Text != "") || MessageBox.Show("Are you sure you want to copy?", Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
			{
				return;
			}
			Dictionary<int, tmpCopy> dictionary = new Dictionary<int, tmpCopy>();
			Dictionary<int, tmpCopy> dictionary2 = new Dictionary<int, tmpCopy>();
			Dictionary<int, tmpCopy> dictionary3 = new Dictionary<int, tmpCopy>();
			FileStream fileStream = new FileStream(txtCopyPath.Text, FileMode.Open);
			byte[] array = new byte[fileStream.Length];
			byte[] array2 = new byte[fileStream.Length];
			fileStream.Read(array, 0, array.Length);
			int i = 0;
			int num = 0;
			for (; i < array.Length; i += 4)
			{
				byte[] bytes = BitConverter.GetBytes(useCipher(BitConverter.ToUInt32(array, i), 0));
				Buffer.BlockCopy(bytes, 0, array2, num, bytes.Length);
				num += bytes.Length;
			}
			fileStream.Close();
			int num2 = 8;
			while (true)
			{
				int num3 = byteToInt32(array2, num2);
				if (num3 == 0)
				{
					break;
				}
				tmpCopy value = new tmpCopy(num3, num2, byteToString(array2, num2 + 8, 32), byteToString(array2, num2 + 116, 248));
				dictionary.Add(num3, value);
				num2 += 808;
			}
			num2 = 16954440;
			while (true)
			{
				int num4 = byteToInt32(array2, num2);
				if (num4 == 0)
				{
					break;
				}
				tmpCopy value2 = new tmpCopy(num4, num2, byteToString(array2, num2 + 4, 32), byteToString(array2, num2 + 76, 400));
				dictionary2.Add(num4, value2);
				num2 += 7860;
			}
			num2 = 13516872;
			while (true)
			{
				int num5 = byteToInt32(array2, num2);
				if (num5 == 0)
				{
					break;
				}
				tmpCopy tmpCopy = new tmpCopy(num5, num2, byteToString(array2, num2 + 4, 32), byteToString(array2, num2 + 148, 60));
				tmpCopy.DescB = byteToString(array2, num2 + 2708, 60);
				dictionary3.Add(num5, tmpCopy);
				num2 += 2964;
			}
			for (int j = 0; j < lstItem.Items.Count; j++)
			{
				editObj editObj = (editObj)lstItem.Items[j];
				if (dictionary.TryGetValue(editObj.ToItemID(), out tmpCopy value3))
				{
					byte[] array3 = stringToByte(value3.ToString(), 32);
					Buffer.BlockCopy(array3, 0, YBI_Data, editObj.StartPosition() + 8, array3.Length);
					byte[] array4 = stringToByte(value3.ToDesc(), 248);
					Buffer.BlockCopy(array4, 0, YBI_Data, editObj.StartPosition() + 116, array4.Length);
				}
			}
			for (int k = 0; k < lstNPC.Items.Count; k++)
			{
				editObj editObj2 = (editObj)lstNPC.Items[k];
				if (dictionary2.TryGetValue(editObj2.ToItemID(), out tmpCopy value4))
				{
					byte[] array5 = stringToByte(value4.ToString(), 32);
					Buffer.BlockCopy(array5, 0, YBI_Data, editObj2.StartPosition() + 4, array5.Length);
					byte[] array6 = stringToByte(value4.ToDesc(), 400);
					Buffer.BlockCopy(array6, 0, YBI_Data, editObj2.StartPosition() + 76, array6.Length);
				}
			}
			for (int l = 0; l < lstAbility.Items.Count; l++)
			{
				editObj editObj3 = (editObj)lstAbility.Items[l];
				if (dictionary3.TryGetValue(editObj3.ToItemID(), out tmpCopy value5))
				{
					byte[] array7 = stringToByte(value5.ToString(), 32);
					Buffer.BlockCopy(array7, 0, YBI_Data, editObj3.StartPosition() + 4, array7.Length);
					byte[] array8 = stringToByte(value5.ToDesc(), 60);
					Buffer.BlockCopy(array8, 0, YBI_Data, editObj3.StartPosition() + 148, array8.Length);
					byte[] array9 = stringToByte(value5.DescB, 60);
					Buffer.BlockCopy(array9, 0, YBI_Data, editObj3.StartPosition() + 2708, array9.Length);
				}
			}
			Buffer.BlockCopy(array2, 6619208, YBI_Data, 6619208, 1247103);
			Buffer.BlockCopy(array2, 13516871, YBI_Data, 13516871, 649028);
			Buffer.BlockCopy(array2, 34108584, YBI_Data, 34108584, 8528);
			Buffer.BlockCopy(array2, 16551940, YBI_Data, 16551940, 8216);
			ReloadItems();
			ReloadNPC();
			ReloadAbility();
			ReloadMap();
		}

		private void btnCopyBrowse_Click(object sender, EventArgs e)
		{
			OpenFileDialog openFileDialog = new OpenFileDialog();
			openFileDialog.Filter = "YBi.cfg (*.cfg)|*.cfg|All files (*.*)|*.*";
			if (openFileDialog.ShowDialog() == DialogResult.OK)
			{
				txtCopyPath.Text = openFileDialog.FileName;
			}
		}

		private void btnItemSearch_Click(object sender, EventArgs e)
		{
			if (cmbItem.Text == "物品ID")
			{
				for (int i = 0; i < lstItem.Items.Count; i++)
				{
					editObj editObj = (editObj)lstItem.Items[i];
					if (editObj.ToItemID() == int.Parse(txtItemSearch.Text))
					{
						lstItem.SetSelected(i, value: true);
						ItemTempIndex = i;
					}
				}
			}
			if (cmbItem.Text == "物品名字" && txtItemSearch.Text != string.Empty)
			{
				int num = lstItem.FindString(txtItemSearch.Text);
				if (num != -1)
				{
					lstItem.SetSelected(num, value: true);
				}
			}
		}

		private void btnSaveAbility_Click(object sender, EventArgs e)
		{
			if (AbilityTempIndex != -1)
			{
				byte[] array = stringToByte(txtAbilityName.Text, 8);
				Buffer.BlockCopy(array, 0, YBI_Data, AbilityGlobalPosition + Config.AbilityNameSpacing, array.Length);
				byte[] array2 = stringToByte(txtAbilityDesc.Text, 30);
				Buffer.BlockCopy(array2, 0, YBI_Data, AbilityGlobalPosition + Config.AbilityDescONESpacing, array2.Length);
				byte[] array3 = stringToByte(txtAbilityDesc2.Text, 30);
				Buffer.BlockCopy(array3, 0, YBI_Data, AbilityGlobalPosition + Config.AbilityDescTWOSpacing, array3.Length);
				ReloadAbility();
				lstAbility.SetSelected(AbilityTempIndex, value: true);
			}
		}

		private void btnSaveBadWord_Click(object sender, EventArgs e)
		{
			if (MapTempIndex != -1)
			{
				byte[] array = stringToByte(txtBadWord.Text, 32);
				Buffer.BlockCopy(array, 0, YBI_Data, BadGlobalPosition, array.Length);
				ReloadBadWords();
			}
		}

		private void btnSaveItem_Click(object sender, EventArgs e)
		{
			if (ItemTempIndex != -1)
			{
				Buffer.BlockCopy(int32ToByte(int.Parse(txtItemID.Text)), 0, YBI_Data, ItemGlobalPosition, 4);
				byte[] array = stringToByte(txtItemName.Text, 32);
				Buffer.BlockCopy(array, 0, YBI_Data, ItemGlobalPosition + Config.ItemNameSpacing, array.Length);
				byte[] array2 = stringToByte(txtItemDesc.Text, 248);
				Buffer.BlockCopy(array2, 0, YBI_Data, ItemGlobalPosition + Config.ItemDescSpacing, array2.Length);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox1.Text)), 0, YBI_Data, ItemGlobalPosition + 72, 1);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox2.Text)), 0, YBI_Data, ItemGlobalPosition + 76, 1);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox3.Text)), 0, YBI_Data, ItemGlobalPosition + 82, 2);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox4.Text)), 0, YBI_Data, ItemGlobalPosition + 80, 2);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox5.Text)), 0, YBI_Data, ItemGlobalPosition + 84, 2);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox6.Text)), 0, YBI_Data, ItemGlobalPosition + 96, 4);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox9.Text)), 0, YBI_Data, ItemGlobalPosition + 75, 1);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox10.Text)), 0, YBI_Data, ItemGlobalPosition + 78, 2);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox11.Text)), 0, YBI_Data, ItemGlobalPosition + 103, 1);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox12.Text)), 0, YBI_Data, ItemGlobalPosition + 104, 1);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox13.Text)), 0, YBI_Data, ItemGlobalPosition + 74, 1);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox15.Text)), 0, YBI_Data, ItemGlobalPosition + 70, 1);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox7.Text)), 0, YBI_Data, ItemGlobalPosition + 69, 1);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox14.Text)), 0, YBI_Data, ItemGlobalPosition + 372, 4);
				ReloadItems();
				lstItem.SetSelected(ItemTempIndex, value: true);
			}
		}

		private void btnSaveMap_Click(object sender, EventArgs e)
		{
			if (MapTempIndex != -1)
			{
				byte[] array = stringToByte(txtMapName.Text, 16);
				Buffer.BlockCopy(array, 0, YBI_Data, MapGlobalPosition + Config.MapNameSpacing, array.Length);
				ReloadMap();
			}
		}

		private void btnSaveNPC_Click(object sender, EventArgs e)
		{
			if (NPCTempIndex != -1)
			{
				byte[] array = stringToByte(txtNPCName.Text, 32);
				Buffer.BlockCopy(array, 0, YBI_Data, NPCGlobalPosition + Config.NPCNameSpacing, array.Length);
				byte[] array2 = stringToByte(txtNPCDesc.Text, 400);
				Buffer.BlockCopy(array2, 0, YBI_Data, NPCGlobalPosition + Config.NPCDescSpacing, array2.Length);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox8.Text)), 0, YBI_Data, NPCGlobalPosition + 70, 2);
				ReloadNPC();
				lstNPC.SetSelected(NPCTempIndex, value: true);
				txtNPCID.ReadOnly = true;
			}
		}

		private void btnSaveSkill_Click(object sender, EventArgs e)
		{
			if (SkillTempIndex != -1)
			{
				byte[] array = stringToByte(txtSkillName.Text, 18);
				Buffer.BlockCopy(array, 0, YBI_Data, SkillGlobalPosition + Config.SkillNameSpacing, array.Length);
				byte[] array2 = stringToByte(txtSkillDesc.Text, 50);
				Buffer.BlockCopy(array2, 0, YBI_Data, SkillGlobalPosition + Config.SkillDescSpacing, array2.Length);
				ReloadSkills();
				lstSkill.SetSelected(SkillTempIndex, value: true);
			}
		}

		private void btnSaveSpeech_Click(object sender, EventArgs e)
		{
			if (SpeechTempIndex != -1)
			{
				byte[] array = stringToByte(txtSpeechDesc.Text, 60);
				Buffer.BlockCopy(array, 0, speechData, SpeechGlobalPosition + Config.SpeechTextSpacing, array.Length);
				ReloadSpeech();
				lstSpeech.SetSelected(SpeechTempIndex, value: true);
			}
		}

		private void btnSearchAbility_Click(object sender, EventArgs e)
		{
			if (cmbAbility.Text == "ID")
			{
				for (int i = 0; i < lstAbility.Items.Count; i++)
				{
					editObj editObj = (editObj)lstAbility.Items[i];
					if (editObj.ToItemID() == int.Parse(txtAbilitySearch.Text))
					{
						lstAbility.SetSelected(i, value: true);
						AbilityTempIndex = i;
					}
				}
			}
			if (cmbAbility.Text == "Name" && txtAbilitySearch.Text != string.Empty)
			{
				int num = lstAbility.FindString(txtAbilitySearch.Text);
				if (num != -1)
				{
					lstAbility.SetSelected(num, value: true);
				}
			}
		}

		private void btnSearchNPC_Click(object sender, EventArgs e)
		{
			if (cmbNPCType.Text == "ID")
			{
				for (int i = 0; i < lstNPC.Items.Count; i++)
				{
					editObj editObj = (editObj)lstNPC.Items[i];
					if (editObj.ToItemID() == int.Parse(txtNPCSearch.Text))
					{
						lstNPC.SetSelected(i, value: true);
						NPCTempIndex = i;
					}
				}
			}
			if (cmbNPCType.Text == "Name" && txtNPCSearch.Text != string.Empty)
			{
				int num = lstNPC.FindString(txtNPCSearch.Text);
				if (num != -1)
				{
					lstNPC.SetSelected(num, value: true);
				}
			}
		}

		private void btnSearchSpeech_Click(object sender, EventArgs e)
		{
			if (!(cmbSpeech.Text == "ID"))
			{
				return;
			}
			for (int i = 0; i < lstSpeech.Items.Count; i++)
			{
				editObj editObj = (editObj)lstSpeech.Items[i];
				if (editObj.ToItemID() == int.Parse(txtSpeechSearch.Text))
				{
					lstSpeech.SetSelected(i, value: true);
					SpeechTempIndex = i;
				}
			}
		}

		private void btnSkillSearch_Click(object sender, EventArgs e)
		{
			if (cmbSkill.Text == "ID")
			{
				for (int i = 0; i < lstSkill.Items.Count; i++)
				{
					editObj editObj = (editObj)lstSkill.Items[i];
					if (editObj.ToItemID() == int.Parse(txtSkillSearch.Text))
					{
						lstSkill.SetSelected(i, value: true);
						SkillTempIndex = i;
					}
				}
			}
			if (cmbSkill.Text == "Name" && txtSkillSearch.Text != string.Empty)
			{
				int num = lstSkill.FindString(txtSkillSearch.Text);
				if (num != -1)
				{
					lstSkill.SetSelected(num, value: true);
				}
			}
		}

		private void button1_Click(object sender, EventArgs e)
		{
			string[] array = File.ReadAllLines("C:\\speech.txt");
			int num = 0;
			foreach (object item in lstSpeech.Items)
			{
				editObj editObj = (editObj)item;
				byte[] array2 = stringToByte(array[num], 80);
				Buffer.BlockCopy(array2, 0, speechData, editObj.StartPosition() + 20, array2.Length);
				num++;
				if (num == array.Count() - 1)
				{
					num = 0;
				}
			}
			ReloadSpeech();
		}

		public string ByteToHexString(byte[] srcbyte, int start, int length)
		{
			byte[] array = new byte[length];
			Buffer.BlockCopy(srcbyte, start, array, 0, length);
			StringBuilder stringBuilder = new StringBuilder(array.Length * 2);
			byte[] array2 = array;
			byte[] array3 = array2;
			foreach (byte b in array3)
			{
				stringBuilder.Append(b.ToString("X2"));
			}
			return stringBuilder.ToString();
		}

		private void button3_Click(object sender, EventArgs e)
		{
			Buffer.BlockCopy(int32ToByte(int.Parse(txtItemID.Text)), 0, YBI_Data, itemPosition, 4);
			byte[] array = stringToByte(txtItemName.Text, 32);
			Buffer.BlockCopy(array, 0, YBI_Data, itemPosition + Config.ItemNameSpacing, array.Length);
			byte[] array2 = stringToByte(txtItemDesc.Text, 248);
			Buffer.BlockCopy(array2, 0, YBI_Data, itemPosition + Config.ItemDescSpacing, array2.Length);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox1.Text)), 0, YBI_Data, itemPosition + 72, 1);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox2.Text)), 0, YBI_Data, itemPosition + 76, 1);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox3.Text)), 0, YBI_Data, itemPosition + 82, 2);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox4.Text)), 0, YBI_Data, itemPosition + 80, 2);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox5.Text)), 0, YBI_Data, itemPosition + 84, 2);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox6.Text)), 0, YBI_Data, itemPosition + 96, 4);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox9.Text)), 0, YBI_Data, itemPosition + 75, 1);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox10.Text)), 0, YBI_Data, itemPosition + 78, 1);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox11.Text)), 0, YBI_Data, itemPosition + 103, 1);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox12.Text)), 0, YBI_Data, itemPosition + 104, 1);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox13.Text)), 0, YBI_Data, itemPosition + 74, 1);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox15.Text)), 0, YBI_Data, itemPosition + 70, 1);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox7.Text)), 0, YBI_Data, itemPosition + 69, 1);
			Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox14.Text)), 0, YBI_Data, itemPosition + 372, 4);
			ReloadItems();
			lstItem.SetSelected(lstItem.Items.Count - 1, value: true);
		}

		private short byteToInt16(byte[] data, int position)
		{
			return BitConverter.ToInt16(data, position);
		}

		private int byteToInt32(byte[] data, int position)
		{
			if (data == null || data.Length < 1)
			{
				return 0;
			}
			return BitConverter.ToInt32(data, position);
		}

		private string byteToString(byte[] data, int startpos, int length)
		{
			byte[] array = new byte[length];
			Buffer.BlockCopy(data, startpos, array, 0, length);
			return Encoding.GetEncoding("gb2312").GetString(array);
		}

		private byte[] CopyToBig(byte[] bBig, byte[] bSmall)
		{
			byte[] array = new byte[bBig.Length + bSmall.Length];
			Buffer.BlockCopy(bBig, 0, array, 0, bBig.Length);
			Buffer.BlockCopy(bSmall, 0, array, bBig.Length, bSmall.Length);
			return array;
		}

		private void creditsToolStripMenuItem_Click(object sender, EventArgs e)
		{
			MessageBox.Show("YBI作者：大王" + Environment.NewLine + "QQ: 593323947" + Environment.NewLine, Text, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
		}

		private void crypterToolStripMenuItem_Click(object sender, EventArgs e)
		{
			int inlen = (MessageBox.Show("Are you decrypting?", "Information Required!", MessageBoxButtons.YesNo) != DialogResult.Yes) ? 1 : 0;
			OpenFileDialog openFileDialog = new OpenFileDialog();
			openFileDialog.Filter = "YBi.cfg (*.cfg)|*.cfg|All files (*.*)|*.*";
			if (openFileDialog.ShowDialog() != DialogResult.OK)
			{
				return;
			}
			byte[] array = File.ReadAllBytes(openFileDialog.FileName);
			SaveFileDialog saveFileDialog = new SaveFileDialog();
			saveFileDialog.Filter = "YBi.cfg (*.cfg)|*.cfg|All files (*.*)|*.*";
			if (saveFileDialog.ShowDialog() == DialogResult.OK)
			{
				byte[] array2 = new byte[array.Length];
				int i = 0;
				int num = 0;
				for (; i < array.Length; i += 4)
				{
					byte[] bytes = BitConverter.GetBytes(useCipher(BitConverter.ToUInt32(array, i), inlen));
					Buffer.BlockCopy(bytes, 0, array2, num, bytes.Length);
					num += bytes.Length;
				}
				FileStream fileStream = new FileStream(saveFileDialog.FileName, FileMode.Create, FileAccess.ReadWrite);
				fileStream.Write(array2, 0, array2.Length);
				fileStream.Close();
				MessageBox.Show("YBi.cfg 保存成功!", Text, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
		}

		protected override void Dispose(bool disposing)
		{
			if (disposing && components != null)
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		private void ExtendItems(byte[] ybi_data)
		{
			int num = Config1.ItemStartPosition;
			while (true)
			{
				int num2 = byteToInt32(ybi_data, num);
				if (num2 == 0)
				{
					break;
				}
				editObj editObj = new editObj(num2, num, byteToString(ybi_data, num + Config1.ItemNameSpacing, 32));
				if (!lstItem.Items.Contains(editObj))
				{
					lstItem.Items.Add(editObj);
				}
				num += Config1.ItemJumpValue;
			}
		}

		private void extendItemsToolStripMenuItem_Click(object sender, EventArgs e)
		{
			ExtendItems(getbuffData());
		}

		private void ExtendMap(byte[] ybi_data)
		{
			int num = Config1.MapStartPosition;
			while (true)
			{
				int num2 = byteToInt32(YBI_Data, num);
				if (num2 == 0)
				{
					break;
				}
				editObj editObj = new editObj(num2, num, byteToString(YBI_Data, num + Config1.MapNameSpacing, 32));
				if (!lstMap.Items.Contains(editObj))
				{
					lstMap.Items.Add(editObj);
				}
				num += Config.MapJumpValue;
			}
		}

		private void ExtendNpc(byte[] ybi_data)
		{
			int num = Config.NPCStartPosition;
			while (true)
			{
				int num2 = byteToInt32(YBI_Data, num);
				if (num2 == 0)
				{
					break;
				}
				editObj editObj = new editObj(num2, num, byteToString(YBI_Data, num + Config.NPCNameSpacing, 32));
				if (!lstNPC.Items.Contains(editObj))
				{
					lstNPC.Items.Add(editObj);
				}
				lstNPC.Items.Add(editObj);
				num += Config.NPCJumpValue;
			}
		}

		private void extraToolStripMenuItem_Click(object sender, EventArgs e)
		{
		}

		private void frmYBI_Load(object sender, EventArgs e)
		{
			tabControl1.Enabled = false;
			tabPage5.Enabled = false;
			saveToolStripMenuItem.Enabled = false;
		}

		public byte[] getbuffData()
		{
			byte[] result = null;
			Config1.LoadConfig();
			OpenFileDialog openFileDialog = new OpenFileDialog();
			openFileDialog.Filter = "YBi.cfg (*.cfg)|*.cfg|All files (*.*)|*.*";
			if (openFileDialog.ShowDialog() != DialogResult.OK)
			{
				return result;
			}
			FileStream fileStream = new FileStream(openFileDialog.FileName, FileMode.Open);
			byte[] array = new byte[fileStream.Length];
			byte[] array2 = new byte[fileStream.Length];
			fileStream.Read(array, 0, array.Length);
			int i = 0;
			int num = 0;
			for (; i < array.Length; i += 4)
			{
				byte[] bytes = BitConverter.GetBytes(useCipher(BitConverter.ToUInt32(array, i), 0));
				Buffer.BlockCopy(bytes, 0, array2, num, bytes.Length);
				num += bytes.Length;
			}
			fileStream.Close();
			tabControl1.Enabled = true;
			saveToolStripMenuItem.Enabled = true;
			return array2;
		}

		private void InitializeComponent()
		{
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(YulgangMarkup.frmYBI));
			menuStrip1 = new System.Windows.Forms.MenuStrip();
			fToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			yBIEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			speechInfoEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			loadToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
			saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
			extendItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			导入YBI新怪物ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			lstItem = new System.Windows.Forms.ListBox();
			tabControl1 = new System.Windows.Forms.TabControl();
			tabPage1 = new System.Windows.Forms.TabPage();
			textBox14 = new System.Windows.Forms.TextBox();
			label42 = new System.Windows.Forms.Label();
			textBox15 = new System.Windows.Forms.TextBox();
			label43 = new System.Windows.Forms.Label();
			textBox13 = new System.Windows.Forms.TextBox();
			label41 = new System.Windows.Forms.Label();
			textBox12 = new System.Windows.Forms.TextBox();
			label40 = new System.Windows.Forms.Label();
			textBox11 = new System.Windows.Forms.TextBox();
			label39 = new System.Windows.Forms.Label();
			textBox10 = new System.Windows.Forms.TextBox();
			label38 = new System.Windows.Forms.Label();
			textBox9 = new System.Windows.Forms.TextBox();
			label37 = new System.Windows.Forms.Label();
			btn_delLastItem = new System.Windows.Forms.Button();
			button3 = new System.Windows.Forms.Button();
			label36 = new System.Windows.Forms.Label();
			textBox7 = new System.Windows.Forms.TextBox();
			textBox6 = new System.Windows.Forms.TextBox();
			label34 = new System.Windows.Forms.Label();
			textBox5 = new System.Windows.Forms.TextBox();
			label33 = new System.Windows.Forms.Label();
			textBox4 = new System.Windows.Forms.TextBox();
			label32 = new System.Windows.Forms.Label();
			textBox3 = new System.Windows.Forms.TextBox();
			label31 = new System.Windows.Forms.Label();
			textBox2 = new System.Windows.Forms.TextBox();
			label30 = new System.Windows.Forms.Label();
			textBox1 = new System.Windows.Forms.TextBox();
			label29 = new System.Windows.Forms.Label();
			txtItemSearch = new System.Windows.Forms.TextBox();
			btnItemSearch = new System.Windows.Forms.Button();
			cmbItem = new System.Windows.Forms.ComboBox();
			label3 = new System.Windows.Forms.Label();
			btnSaveItem = new System.Windows.Forms.Button();
			label4 = new System.Windows.Forms.Label();
			txtItemDesc = new System.Windows.Forms.TextBox();
			label2 = new System.Windows.Forms.Label();
			txtItemName = new System.Windows.Forms.TextBox();
			label1 = new System.Windows.Forms.Label();
			txtItemID = new System.Windows.Forms.TextBox();
			tabPage2 = new System.Windows.Forms.TabPage();
			btn_delNPC = new System.Windows.Forms.Button();
			btn_EnableNPCID = new System.Windows.Forms.Button();
			btn_AddNPC = new System.Windows.Forms.Button();
			textBox8 = new System.Windows.Forms.TextBox();
			label35 = new System.Windows.Forms.Label();
			txtNPCSearch = new System.Windows.Forms.TextBox();
			btnSaveNPC = new System.Windows.Forms.Button();
			label5 = new System.Windows.Forms.Label();
			txtNPCDesc = new System.Windows.Forms.TextBox();
			btnSearchNPC = new System.Windows.Forms.Button();
			cmbNPCType = new System.Windows.Forms.ComboBox();
			label6 = new System.Windows.Forms.Label();
			label7 = new System.Windows.Forms.Label();
			txtNPCName = new System.Windows.Forms.TextBox();
			label8 = new System.Windows.Forms.Label();
			txtNPCID = new System.Windows.Forms.TextBox();
			lstNPC = new System.Windows.Forms.ListBox();
			tabPage3 = new System.Windows.Forms.TabPage();
			label15 = new System.Windows.Forms.Label();
			txtAbilityDesc2 = new System.Windows.Forms.TextBox();
			txtAbilitySearch = new System.Windows.Forms.TextBox();
			btnSaveAbility = new System.Windows.Forms.Button();
			label9 = new System.Windows.Forms.Label();
			txtAbilityDesc = new System.Windows.Forms.TextBox();
			btnSearchAbility = new System.Windows.Forms.Button();
			cmbAbility = new System.Windows.Forms.ComboBox();
			label10 = new System.Windows.Forms.Label();
			label11 = new System.Windows.Forms.Label();
			txtAbilityName = new System.Windows.Forms.TextBox();
			label12 = new System.Windows.Forms.Label();
			txtAbilityID = new System.Windows.Forms.TextBox();
			lstAbility = new System.Windows.Forms.ListBox();
			tabPage6 = new System.Windows.Forms.TabPage();
			btnSaveMap = new System.Windows.Forms.Button();
			label22 = new System.Windows.Forms.Label();
			txtMapName = new System.Windows.Forms.TextBox();
			label21 = new System.Windows.Forms.Label();
			txtMapID = new System.Windows.Forms.TextBox();
			lstMap = new System.Windows.Forms.ListBox();
			tabPage7 = new System.Windows.Forms.TabPage();
			txtSkillSearch = new System.Windows.Forms.TextBox();
			btnSaveSkill = new System.Windows.Forms.Button();
			label23 = new System.Windows.Forms.Label();
			txtSkillDesc = new System.Windows.Forms.TextBox();
			btnSkillSearch = new System.Windows.Forms.Button();
			cmbSkill = new System.Windows.Forms.ComboBox();
			label24 = new System.Windows.Forms.Label();
			label25 = new System.Windows.Forms.Label();
			txtSkillName = new System.Windows.Forms.TextBox();
			label26 = new System.Windows.Forms.Label();
			txtSkillID = new System.Windows.Forms.TextBox();
			lstSkill = new System.Windows.Forms.ListBox();
			tabPage4 = new System.Windows.Forms.TabPage();
			label16 = new System.Windows.Forms.Label();
			btnCopy = new System.Windows.Forms.Button();
			btnCopyBrowse = new System.Windows.Forms.Button();
			txtCopyPath = new System.Windows.Forms.TextBox();
			label14 = new System.Windows.Forms.Label();
			tabPage5 = new System.Windows.Forms.TabPage();
			button1 = new System.Windows.Forms.Button();
			button2 = new System.Windows.Forms.Button();
			txtSpeechSearch = new System.Windows.Forms.TextBox();
			btnSaveSpeech = new System.Windows.Forms.Button();
			label17 = new System.Windows.Forms.Label();
			txtSpeechDesc = new System.Windows.Forms.TextBox();
			cmbSpeech = new System.Windows.Forms.ComboBox();
			label18 = new System.Windows.Forms.Label();
			label19 = new System.Windows.Forms.Label();
			txtSpeechNPCID = new System.Windows.Forms.TextBox();
			label20 = new System.Windows.Forms.Label();
			txtSpeechID = new System.Windows.Forms.TextBox();
			lstSpeech = new System.Windows.Forms.ListBox();
			tabPage8 = new System.Windows.Forms.TabPage();
			btnSaveBadWord = new System.Windows.Forms.Button();
			label27 = new System.Windows.Forms.Label();
			txtBadWord = new System.Windows.Forms.TextBox();
			label28 = new System.Windows.Forms.Label();
			txtBadWordID = new System.Windows.Forms.TextBox();
			lstBadWords = new System.Windows.Forms.ListBox();
			menuStrip1.SuspendLayout();
			tabControl1.SuspendLayout();
			tabPage1.SuspendLayout();
			tabPage2.SuspendLayout();
			tabPage3.SuspendLayout();
			tabPage6.SuspendLayout();
			tabPage7.SuspendLayout();
			tabPage4.SuspendLayout();
			tabPage5.SuspendLayout();
			tabPage8.SuspendLayout();
			SuspendLayout();
			menuStrip1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[1]
			{
				fToolStripMenuItem
			});
			menuStrip1.Location = new System.Drawing.Point(0, 0);
			menuStrip1.Name = "menuStrip1";
			menuStrip1.Size = new System.Drawing.Size(568, 25);
			menuStrip1.TabIndex = 0;
			menuStrip1.Text = "menuStrip1";
			fToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[4]
			{
				yBIEditorToolStripMenuItem,
				speechInfoEditorToolStripMenuItem,
				extendItemsToolStripMenuItem,
				导入YBI新怪物ToolStripMenuItem
			});
			fToolStripMenuItem.Name = "fToolStripMenuItem";
			fToolStripMenuItem.Size = new System.Drawing.Size(44, 21);
			fToolStripMenuItem.Text = "菜单";
			yBIEditorToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[2]
			{
				loadToolStripMenuItem,
				saveToolStripMenuItem
			});
			yBIEditorToolStripMenuItem.Name = "yBIEditorToolStripMenuItem";
			yBIEditorToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
			yBIEditorToolStripMenuItem.Text = "YBI工具";
			loadToolStripMenuItem.Name = "loadToolStripMenuItem";
			loadToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
			loadToolStripMenuItem.Text = "读取YBI";
			loadToolStripMenuItem.Click += new System.EventHandler(loadToolStripMenuItem_Click_1);
			saveToolStripMenuItem.Enabled = false;
			saveToolStripMenuItem.Name = "saveToolStripMenuItem";
			saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
			saveToolStripMenuItem.Text = "保存YBI";
			saveToolStripMenuItem.Click += new System.EventHandler(saveToolStripMenuItem_Click_1);
			speechInfoEditorToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[2]
			{
				loadToolStripMenuItem1,
				saveToolStripMenuItem1
			});
			speechInfoEditorToolStripMenuItem.Name = "speechInfoEditorToolStripMenuItem";
			speechInfoEditorToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
			speechInfoEditorToolStripMenuItem.Text = "NPC说话气泡编辑";
			loadToolStripMenuItem1.Name = "loadToolStripMenuItem1";
			loadToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
			loadToolStripMenuItem1.Text = "读取";
			loadToolStripMenuItem1.Click += new System.EventHandler(loadToolStripMenuItem1_Click_1);
			saveToolStripMenuItem1.Enabled = false;
			saveToolStripMenuItem1.Name = "saveToolStripMenuItem1";
			saveToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
			saveToolStripMenuItem1.Text = "保存";
			saveToolStripMenuItem1.Click += new System.EventHandler(saveToolStripMenuItem1_Click);
			extendItemsToolStripMenuItem.Name = "extendItemsToolStripMenuItem";
			extendItemsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
			extendItemsToolStripMenuItem.Text = "导入新YBI数据";
			extendItemsToolStripMenuItem.Click += new System.EventHandler(extendItemsToolStripMenuItem_Click);
			导入YBI新怪物ToolStripMenuItem.Enabled = false;
			导入YBI新怪物ToolStripMenuItem.Name = "导入YBI新怪物ToolStripMenuItem";
			导入YBI新怪物ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
			导入YBI新怪物ToolStripMenuItem.Text = "导入YBI新怪物";
			导入YBI新怪物ToolStripMenuItem.Click += new System.EventHandler(导入YBI新怪物ToolStripMenuItem_Click);
			lstItem.FormattingEnabled = true;
			lstItem.ItemHeight = 12;
			lstItem.Location = new System.Drawing.Point(6, 3);
			lstItem.Name = "lstItem";
			lstItem.Size = new System.Drawing.Size(132, 388);
			lstItem.TabIndex = 1;
			lstItem.SelectedIndexChanged += new System.EventHandler(lstItem_SelectedIndexChanged);
			tabControl1.Controls.Add(tabPage1);
			tabControl1.Controls.Add(tabPage2);
			tabControl1.Controls.Add(tabPage3);
			tabControl1.Controls.Add(tabPage6);
			tabControl1.Controls.Add(tabPage7);
			tabControl1.Controls.Add(tabPage4);
			tabControl1.Controls.Add(tabPage5);
			tabControl1.Controls.Add(tabPage8);
			tabControl1.Location = new System.Drawing.Point(0, 25);
			tabControl1.Name = "tabControl1";
			tabControl1.SelectedIndex = 0;
			tabControl1.Size = new System.Drawing.Size(553, 428);
			tabControl1.TabIndex = 2;
			tabPage1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			tabPage1.Controls.Add(textBox14);
			tabPage1.Controls.Add(label42);
			tabPage1.Controls.Add(textBox15);
			tabPage1.Controls.Add(label43);
			tabPage1.Controls.Add(textBox13);
			tabPage1.Controls.Add(label41);
			tabPage1.Controls.Add(textBox12);
			tabPage1.Controls.Add(label40);
			tabPage1.Controls.Add(textBox11);
			tabPage1.Controls.Add(label39);
			tabPage1.Controls.Add(textBox10);
			tabPage1.Controls.Add(label38);
			tabPage1.Controls.Add(textBox9);
			tabPage1.Controls.Add(label37);
			tabPage1.Controls.Add(btn_delLastItem);
			tabPage1.Controls.Add(button3);
			tabPage1.Controls.Add(label36);
			tabPage1.Controls.Add(textBox7);
			tabPage1.Controls.Add(textBox6);
			tabPage1.Controls.Add(label34);
			tabPage1.Controls.Add(textBox5);
			tabPage1.Controls.Add(label33);
			tabPage1.Controls.Add(textBox4);
			tabPage1.Controls.Add(label32);
			tabPage1.Controls.Add(textBox3);
			tabPage1.Controls.Add(label31);
			tabPage1.Controls.Add(textBox2);
			tabPage1.Controls.Add(label30);
			tabPage1.Controls.Add(textBox1);
			tabPage1.Controls.Add(label29);
			tabPage1.Controls.Add(txtItemSearch);
			tabPage1.Controls.Add(btnItemSearch);
			tabPage1.Controls.Add(cmbItem);
			tabPage1.Controls.Add(label3);
			tabPage1.Controls.Add(btnSaveItem);
			tabPage1.Controls.Add(label4);
			tabPage1.Controls.Add(txtItemDesc);
			tabPage1.Controls.Add(label2);
			tabPage1.Controls.Add(txtItemName);
			tabPage1.Controls.Add(label1);
			tabPage1.Controls.Add(txtItemID);
			tabPage1.Controls.Add(lstItem);
			tabPage1.Location = new System.Drawing.Point(4, 22);
			tabPage1.Name = "tabPage1";
			tabPage1.Padding = new System.Windows.Forms.Padding(3);
			tabPage1.Size = new System.Drawing.Size(545, 402);
			tabPage1.TabIndex = 0;
			tabPage1.Text = "物品修改";
			tabPage1.UseVisualStyleBackColor = true;
			textBox14.Location = new System.Drawing.Point(369, 186);
			textBox14.Name = "textBox14";
			textBox14.Size = new System.Drawing.Size(45, 21);
			textBox14.TabIndex = 60;
			label42.AutoSize = true;
			label42.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label42.Location = new System.Drawing.Point(311, 191);
			label42.Name = "label42";
			label42.Size = new System.Drawing.Size(59, 12);
			label42.TabIndex = 59;
			label42.Text = "武勋阶段:";
			textBox15.Location = new System.Drawing.Point(337, 157);
			textBox15.Name = "textBox15";
			textBox15.Size = new System.Drawing.Size(45, 21);
			textBox15.TabIndex = 58;
			label43.AutoSize = true;
			label43.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label43.Location = new System.Drawing.Point(272, 163);
			label43.Name = "label43";
			label43.Size = new System.Drawing.Size(59, 12);
			label43.TabIndex = 57;
			label43.Text = "物品职业:";
			textBox13.Location = new System.Drawing.Point(337, 131);
			textBox13.Name = "textBox13";
			textBox13.Size = new System.Drawing.Size(45, 21);
			textBox13.TabIndex = 54;
			label41.AutoSize = true;
			label41.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label41.Location = new System.Drawing.Point(273, 137);
			label41.Name = "label41";
			label41.Size = new System.Drawing.Size(59, 12);
			label41.TabIndex = 53;
			label41.Text = "物品几转:";
			textBox12.Location = new System.Drawing.Point(420, 160);
			textBox12.Name = "textBox12";
			textBox12.Size = new System.Drawing.Size(45, 21);
			textBox12.TabIndex = 52;
			label40.AutoSize = true;
			label40.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label40.Location = new System.Drawing.Point(388, 163);
			label40.Name = "label40";
			label40.Size = new System.Drawing.Size(35, 12);
			label40.TabIndex = 51;
			label40.Text = "恶灵:";
			textBox11.Location = new System.Drawing.Point(420, 130);
			textBox11.Name = "textBox11";
			textBox11.Size = new System.Drawing.Size(45, 21);
			textBox11.TabIndex = 50;
			label39.AutoSize = true;
			label39.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label39.Location = new System.Drawing.Point(388, 137);
			label39.Name = "label39";
			label39.Size = new System.Drawing.Size(41, 12);
			label39.TabIndex = 49;
			label39.Text = "参数2:";
			textBox10.Location = new System.Drawing.Point(420, 103);
			textBox10.Name = "textBox10";
			textBox10.Size = new System.Drawing.Size(45, 21);
			textBox10.TabIndex = 48;
			label38.AutoSize = true;
			label38.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label38.Location = new System.Drawing.Point(388, 112);
			label38.Name = "label38";
			label38.Size = new System.Drawing.Size(35, 12);
			label38.TabIndex = 47;
			label38.Text = "重量:";
			textBox9.Location = new System.Drawing.Point(420, 77);
			textBox9.Name = "textBox9";
			textBox9.Size = new System.Drawing.Size(45, 21);
			textBox9.TabIndex = 46;
			label37.AutoSize = true;
			label37.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label37.Location = new System.Drawing.Point(388, 82);
			label37.Name = "label37";
			label37.Size = new System.Drawing.Size(35, 12);
			label37.TabIndex = 45;
			label37.Text = "性别:";
			btn_delLastItem.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			btn_delLastItem.Location = new System.Drawing.Point(410, 357);
			btn_delLastItem.Name = "btn_delLastItem";
			btn_delLastItem.Size = new System.Drawing.Size(108, 31);
			btn_delLastItem.TabIndex = 44;
			btn_delLastItem.Text = "删除最后一个";
			btn_delLastItem.UseVisualStyleBackColor = true;
			btn_delLastItem.Click += new System.EventHandler(btn_delLastItem_Click);
			button3.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			button3.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			button3.Location = new System.Drawing.Point(147, 357);
			button3.Name = "button3";
			button3.Size = new System.Drawing.Size(95, 31);
			button3.TabIndex = 43;
			button3.Text = "添加新物品";
			button3.UseVisualStyleBackColor = false;
			button3.Click += new System.EventHandler(button3_Click);
			label36.AutoSize = true;
			label36.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label36.Location = new System.Drawing.Point(144, 166);
			label36.Name = "label36";
			label36.Size = new System.Drawing.Size(59, 12);
			label36.TabIndex = 42;
			label36.Text = "物品正邪:";
			textBox7.Location = new System.Drawing.Point(209, 163);
			textBox7.Name = "textBox7";
			textBox7.Size = new System.Drawing.Size(45, 21);
			textBox7.TabIndex = 41;
			textBox6.Location = new System.Drawing.Point(209, 188);
			textBox6.Name = "textBox6";
			textBox6.Size = new System.Drawing.Size(73, 21);
			textBox6.TabIndex = 39;
			label34.AutoSize = true;
			label34.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label34.Location = new System.Drawing.Point(144, 190);
			label34.Name = "label34";
			label34.Size = new System.Drawing.Size(59, 12);
			label34.TabIndex = 38;
			label34.Text = "物品价格:";
			textBox5.Location = new System.Drawing.Point(210, 135);
			textBox5.Name = "textBox5";
			textBox5.Size = new System.Drawing.Size(45, 21);
			textBox5.TabIndex = 37;
			label33.AutoSize = true;
			label33.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label33.Location = new System.Drawing.Point(145, 140);
			label33.Name = "label33";
			label33.Size = new System.Drawing.Size(59, 12);
			label33.TabIndex = 36;
			label33.Text = "物品防御:";
			textBox4.Location = new System.Drawing.Point(337, 106);
			textBox4.Name = "textBox4";
			textBox4.Size = new System.Drawing.Size(45, 21);
			textBox4.TabIndex = 35;
			label32.AutoSize = true;
			label32.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label32.Location = new System.Drawing.Point(272, 112);
			label32.Name = "label32";
			label32.Size = new System.Drawing.Size(65, 12);
			label32.TabIndex = 34;
			label32.Text = "物品攻击2:";
			textBox3.Location = new System.Drawing.Point(209, 107);
			textBox3.Name = "textBox3";
			textBox3.Size = new System.Drawing.Size(45, 21);
			textBox3.TabIndex = 33;
			label31.AutoSize = true;
			label31.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label31.Location = new System.Drawing.Point(144, 112);
			label31.Name = "label31";
			label31.Size = new System.Drawing.Size(65, 12);
			label31.TabIndex = 32;
			label31.Text = "物品攻击1:";
			textBox2.Location = new System.Drawing.Point(337, 77);
			textBox2.Name = "textBox2";
			textBox2.Size = new System.Drawing.Size(45, 21);
			textBox2.TabIndex = 31;
			label30.AutoSize = true;
			label30.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label30.Location = new System.Drawing.Point(272, 82);
			label30.Name = "label30";
			label30.Size = new System.Drawing.Size(59, 12);
			label30.TabIndex = 30;
			label30.Text = "物品装置:";
			textBox1.Location = new System.Drawing.Point(209, 79);
			textBox1.Name = "textBox1";
			textBox1.Size = new System.Drawing.Size(45, 21);
			textBox1.TabIndex = 29;
			label29.AutoSize = true;
			label29.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label29.Location = new System.Drawing.Point(144, 84);
			label29.Name = "label29";
			label29.Size = new System.Drawing.Size(59, 12);
			label29.TabIndex = 28;
			label29.Text = "物品等级:";
			txtItemSearch.Location = new System.Drawing.Point(274, 28);
			txtItemSearch.Name = "txtItemSearch";
			txtItemSearch.Size = new System.Drawing.Size(96, 21);
			txtItemSearch.TabIndex = 27;
			btnItemSearch.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			btnItemSearch.Location = new System.Drawing.Point(376, 27);
			btnItemSearch.Name = "btnItemSearch";
			btnItemSearch.Size = new System.Drawing.Size(89, 22);
			btnItemSearch.TabIndex = 26;
			btnItemSearch.Text = "搜索";
			btnItemSearch.UseVisualStyleBackColor = false;
			btnItemSearch.Click += new System.EventHandler(btnItemSearch_Click);
			cmbItem.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			cmbItem.FormattingEnabled = true;
			cmbItem.Items.AddRange(new object[2]
			{
				"物品ID",
				"物品名字"
			});
			cmbItem.Location = new System.Drawing.Point(198, 27);
			cmbItem.Name = "cmbItem";
			cmbItem.Size = new System.Drawing.Size(70, 20);
			cmbItem.TabIndex = 25;
			label3.AutoSize = true;
			label3.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label3.Location = new System.Drawing.Point(144, 30);
			label3.Name = "label3";
			label3.Size = new System.Drawing.Size(35, 12);
			label3.TabIndex = 24;
			label3.Text = "搜索:";
			btnSaveItem.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			btnSaveItem.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			btnSaveItem.Location = new System.Drawing.Point(274, 357);
			btnSaveItem.Name = "btnSaveItem";
			btnSaveItem.Size = new System.Drawing.Size(98, 31);
			btnSaveItem.TabIndex = 11;
			btnSaveItem.Text = "保存修改";
			btnSaveItem.UseVisualStyleBackColor = false;
			btnSaveItem.Click += new System.EventHandler(btnSaveItem_Click);
			label4.AutoSize = true;
			label4.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label4.Location = new System.Drawing.Point(145, 214);
			label4.Name = "label4";
			label4.Size = new System.Drawing.Size(35, 12);
			label4.TabIndex = 10;
			label4.Text = "介绍:";
			txtItemDesc.Location = new System.Drawing.Point(147, 229);
			txtItemDesc.Multiline = true;
			txtItemDesc.Name = "txtItemDesc";
			txtItemDesc.Size = new System.Drawing.Size(371, 122);
			txtItemDesc.TabIndex = 9;
			label2.AutoSize = true;
			label2.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label2.Location = new System.Drawing.Point(144, 54);
			label2.Name = "label2";
			label2.Size = new System.Drawing.Size(59, 12);
			label2.TabIndex = 5;
			label2.Text = "物品名字:";
			txtItemName.Location = new System.Drawing.Point(209, 52);
			txtItemName.Name = "txtItemName";
			txtItemName.Size = new System.Drawing.Size(256, 21);
			txtItemName.TabIndex = 4;
			label1.AutoSize = true;
			label1.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label1.Location = new System.Drawing.Point(144, 6);
			label1.Name = "label1";
			label1.Size = new System.Drawing.Size(47, 12);
			label1.TabIndex = 3;
			label1.Text = "物品ID:";
			txtItemID.Location = new System.Drawing.Point(198, 3);
			txtItemID.Name = "txtItemID";
			txtItemID.Size = new System.Drawing.Size(267, 21);
			txtItemID.TabIndex = 2;
			tabPage2.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			tabPage2.Controls.Add(btn_delNPC);
			tabPage2.Controls.Add(btn_EnableNPCID);
			tabPage2.Controls.Add(btn_AddNPC);
			tabPage2.Controls.Add(textBox8);
			tabPage2.Controls.Add(label35);
			tabPage2.Controls.Add(txtNPCSearch);
			tabPage2.Controls.Add(btnSaveNPC);
			tabPage2.Controls.Add(label5);
			tabPage2.Controls.Add(txtNPCDesc);
			tabPage2.Controls.Add(btnSearchNPC);
			tabPage2.Controls.Add(cmbNPCType);
			tabPage2.Controls.Add(label6);
			tabPage2.Controls.Add(label7);
			tabPage2.Controls.Add(txtNPCName);
			tabPage2.Controls.Add(label8);
			tabPage2.Controls.Add(txtNPCID);
			tabPage2.Controls.Add(lstNPC);
			tabPage2.Location = new System.Drawing.Point(4, 22);
			tabPage2.Name = "tabPage2";
			tabPage2.Padding = new System.Windows.Forms.Padding(3);
			tabPage2.Size = new System.Drawing.Size(545, 402);
			tabPage2.TabIndex = 1;
			tabPage2.Text = "NPC修改";
			tabPage2.UseVisualStyleBackColor = true;
			btn_delNPC.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			btn_delNPC.Location = new System.Drawing.Point(377, 276);
			btn_delNPC.Name = "btn_delNPC";
			btn_delNPC.Size = new System.Drawing.Size(89, 34);
			btn_delNPC.TabIndex = 34;
			btn_delNPC.Text = "删除最后一个";
			btn_delNPC.UseVisualStyleBackColor = true;
			btn_delNPC.Click += new System.EventHandler(btn_delNPC_Click);
			btn_EnableNPCID.Location = new System.Drawing.Point(406, 4);
			btn_EnableNPCID.Name = "btn_EnableNPCID";
			btn_EnableNPCID.Size = new System.Drawing.Size(60, 23);
			btn_EnableNPCID.TabIndex = 33;
			btn_EnableNPCID.Text = "可变更";
			btn_EnableNPCID.UseVisualStyleBackColor = true;
			btn_EnableNPCID.Click += new System.EventHandler(btn_EnableNPCID_Click);
			btn_AddNPC.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			btn_AddNPC.Location = new System.Drawing.Point(148, 276);
			btn_AddNPC.Name = "btn_AddNPC";
			btn_AddNPC.Size = new System.Drawing.Size(87, 34);
			btn_AddNPC.TabIndex = 32;
			btn_AddNPC.Text = "新增NPC";
			btn_AddNPC.UseVisualStyleBackColor = false;
			btn_AddNPC.Click += new System.EventHandler(btn_AddNPC_Click);
			textBox8.Location = new System.Drawing.Point(210, 91);
			textBox8.Name = "textBox8";
			textBox8.Size = new System.Drawing.Size(45, 21);
			textBox8.TabIndex = 31;
			label35.AutoSize = true;
			label35.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label35.Location = new System.Drawing.Point(146, 94);
			label35.Name = "label35";
			label35.Size = new System.Drawing.Size(59, 12);
			label35.TabIndex = 30;
			label35.Text = "怪物等级:";
			txtNPCSearch.Location = new System.Drawing.Point(275, 30);
			txtNPCSearch.Name = "txtNPCSearch";
			txtNPCSearch.Size = new System.Drawing.Size(96, 21);
			txtNPCSearch.TabIndex = 23;
			btnSaveNPC.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			btnSaveNPC.Location = new System.Drawing.Point(265, 275);
			btnSaveNPC.Name = "btnSaveNPC";
			btnSaveNPC.Size = new System.Drawing.Size(83, 35);
			btnSaveNPC.TabIndex = 22;
			btnSaveNPC.Text = "保存修改";
			btnSaveNPC.UseVisualStyleBackColor = false;
			btnSaveNPC.Click += new System.EventHandler(btnSaveNPC_Click);
			label5.AutoSize = true;
			label5.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label5.Location = new System.Drawing.Point(146, 128);
			label5.Name = "label5";
			label5.Size = new System.Drawing.Size(35, 12);
			label5.TabIndex = 21;
			label5.Text = "介绍:";
			txtNPCDesc.Location = new System.Drawing.Point(148, 163);
			txtNPCDesc.Multiline = true;
			txtNPCDesc.Name = "txtNPCDesc";
			txtNPCDesc.Size = new System.Drawing.Size(318, 106);
			txtNPCDesc.TabIndex = 20;
			btnSearchNPC.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			btnSearchNPC.Location = new System.Drawing.Point(377, 30);
			btnSearchNPC.Name = "btnSearchNPC";
			btnSearchNPC.Size = new System.Drawing.Size(89, 21);
			btnSearchNPC.TabIndex = 19;
			btnSearchNPC.Text = "搜索";
			btnSearchNPC.UseVisualStyleBackColor = false;
			btnSearchNPC.Click += new System.EventHandler(btnSearchNPC_Click);
			cmbNPCType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			cmbNPCType.FormattingEnabled = true;
			cmbNPCType.Items.AddRange(new object[2]
			{
				"ID",
				"Name"
			});
			cmbNPCType.Location = new System.Drawing.Point(199, 30);
			cmbNPCType.Name = "cmbNPCType";
			cmbNPCType.Size = new System.Drawing.Size(70, 20);
			cmbNPCType.TabIndex = 18;
			label6.AutoSize = true;
			label6.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label6.Location = new System.Drawing.Point(145, 32);
			label6.Name = "label6";
			label6.Size = new System.Drawing.Size(35, 12);
			label6.TabIndex = 17;
			label6.Text = "搜索:";
			label7.AutoSize = true;
			label7.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label7.Location = new System.Drawing.Point(145, 56);
			label7.Name = "label7";
			label7.Size = new System.Drawing.Size(59, 12);
			label7.TabIndex = 16;
			label7.Text = "怪物名字:";
			txtNPCName.Location = new System.Drawing.Point(210, 54);
			txtNPCName.Name = "txtNPCName";
			txtNPCName.Size = new System.Drawing.Size(256, 21);
			txtNPCName.TabIndex = 15;
			label8.AutoSize = true;
			label8.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label8.Location = new System.Drawing.Point(145, 7);
			label8.Name = "label8";
			label8.Size = new System.Drawing.Size(47, 12);
			label8.TabIndex = 14;
			label8.Text = "怪物ID:";
			txtNPCID.Location = new System.Drawing.Point(199, 5);
			txtNPCID.Name = "txtNPCID";
			txtNPCID.ReadOnly = true;
			txtNPCID.Size = new System.Drawing.Size(200, 21);
			txtNPCID.TabIndex = 13;
			lstNPC.FormattingEnabled = true;
			lstNPC.ItemHeight = 12;
			lstNPC.Location = new System.Drawing.Point(7, 5);
			lstNPC.Name = "lstNPC";
			lstNPC.Size = new System.Drawing.Size(132, 304);
			lstNPC.TabIndex = 12;
			lstNPC.SelectedIndexChanged += new System.EventHandler(lstNPC_SelectedIndexChanged);
			tabPage3.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			tabPage3.Controls.Add(label15);
			tabPage3.Controls.Add(txtAbilityDesc2);
			tabPage3.Controls.Add(txtAbilitySearch);
			tabPage3.Controls.Add(btnSaveAbility);
			tabPage3.Controls.Add(label9);
			tabPage3.Controls.Add(txtAbilityDesc);
			tabPage3.Controls.Add(btnSearchAbility);
			tabPage3.Controls.Add(cmbAbility);
			tabPage3.Controls.Add(label10);
			tabPage3.Controls.Add(label11);
			tabPage3.Controls.Add(txtAbilityName);
			tabPage3.Controls.Add(label12);
			tabPage3.Controls.Add(txtAbilityID);
			tabPage3.Controls.Add(lstAbility);
			tabPage3.Location = new System.Drawing.Point(4, 22);
			tabPage3.Name = "tabPage3";
			tabPage3.Padding = new System.Windows.Forms.Padding(3);
			tabPage3.Size = new System.Drawing.Size(545, 402);
			tabPage3.TabIndex = 2;
			tabPage3.Text = "气功修改";
			tabPage3.UseVisualStyleBackColor = true;
			label15.AutoSize = true;
			label15.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label15.Location = new System.Drawing.Point(146, 208);
			label15.Name = "label15";
			label15.Size = new System.Drawing.Size(47, 12);
			label15.TabIndex = 37;
			label15.Text = "介绍二:";
			txtAbilityDesc2.Location = new System.Drawing.Point(148, 232);
			txtAbilityDesc2.Multiline = true;
			txtAbilityDesc2.Name = "txtAbilityDesc2";
			txtAbilityDesc2.Size = new System.Drawing.Size(318, 95);
			txtAbilityDesc2.TabIndex = 36;
			txtAbilitySearch.Location = new System.Drawing.Point(275, 30);
			txtAbilitySearch.Name = "txtAbilitySearch";
			txtAbilitySearch.Size = new System.Drawing.Size(96, 21);
			txtAbilitySearch.TabIndex = 35;
			btnSaveAbility.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			btnSaveAbility.Location = new System.Drawing.Point(348, 341);
			btnSaveAbility.Name = "btnSaveAbility";
			btnSaveAbility.Size = new System.Drawing.Size(118, 28);
			btnSaveAbility.TabIndex = 34;
			btnSaveAbility.Text = "确认修改";
			btnSaveAbility.UseVisualStyleBackColor = false;
			btnSaveAbility.Click += new System.EventHandler(btnSaveAbility_Click);
			label9.AutoSize = true;
			label9.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label9.Location = new System.Drawing.Point(145, 81);
			label9.Name = "label9";
			label9.Size = new System.Drawing.Size(47, 12);
			label9.TabIndex = 33;
			label9.Text = "介绍一:";
			txtAbilityDesc.Location = new System.Drawing.Point(148, 99);
			txtAbilityDesc.Multiline = true;
			txtAbilityDesc.Name = "txtAbilityDesc";
			txtAbilityDesc.Size = new System.Drawing.Size(318, 93);
			txtAbilityDesc.TabIndex = 32;
			btnSearchAbility.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			btnSearchAbility.Location = new System.Drawing.Point(377, 30);
			btnSearchAbility.Name = "btnSearchAbility";
			btnSearchAbility.Size = new System.Drawing.Size(89, 18);
			btnSearchAbility.TabIndex = 31;
			btnSearchAbility.Text = "搜索";
			btnSearchAbility.UseVisualStyleBackColor = false;
			btnSearchAbility.Click += new System.EventHandler(btnSearchAbility_Click);
			cmbAbility.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			cmbAbility.FormattingEnabled = true;
			cmbAbility.Items.AddRange(new object[2]
			{
				"ID",
				"Name"
			});
			cmbAbility.Location = new System.Drawing.Point(199, 30);
			cmbAbility.Name = "cmbAbility";
			cmbAbility.Size = new System.Drawing.Size(70, 20);
			cmbAbility.TabIndex = 30;
			label10.AutoSize = true;
			label10.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label10.Location = new System.Drawing.Point(145, 32);
			label10.Name = "label10";
			label10.Size = new System.Drawing.Size(35, 12);
			label10.TabIndex = 29;
			label10.Text = "搜索:";
			label11.AutoSize = true;
			label11.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label11.Location = new System.Drawing.Point(145, 56);
			label11.Name = "label11";
			label11.Size = new System.Drawing.Size(35, 12);
			label11.TabIndex = 28;
			label11.Text = "名字:";
			txtAbilityName.Location = new System.Drawing.Point(199, 54);
			txtAbilityName.Name = "txtAbilityName";
			txtAbilityName.Size = new System.Drawing.Size(267, 21);
			txtAbilityName.TabIndex = 27;
			label12.AutoSize = true;
			label12.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label12.Location = new System.Drawing.Point(145, 7);
			label12.Name = "label12";
			label12.Size = new System.Drawing.Size(47, 12);
			label12.TabIndex = 26;
			label12.Text = "气功ID:";
			txtAbilityID.Location = new System.Drawing.Point(199, 5);
			txtAbilityID.Name = "txtAbilityID";
			txtAbilityID.ReadOnly = true;
			txtAbilityID.Size = new System.Drawing.Size(267, 21);
			txtAbilityID.TabIndex = 25;
			lstAbility.FormattingEnabled = true;
			lstAbility.ItemHeight = 12;
			lstAbility.Location = new System.Drawing.Point(7, 5);
			lstAbility.Name = "lstAbility";
			lstAbility.Size = new System.Drawing.Size(132, 364);
			lstAbility.TabIndex = 24;
			lstAbility.SelectedIndexChanged += new System.EventHandler(lstAbility_SelectedIndexChanged);
			tabPage6.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			tabPage6.Controls.Add(btnSaveMap);
			tabPage6.Controls.Add(label22);
			tabPage6.Controls.Add(txtMapName);
			tabPage6.Controls.Add(label21);
			tabPage6.Controls.Add(txtMapID);
			tabPage6.Controls.Add(lstMap);
			tabPage6.Location = new System.Drawing.Point(4, 22);
			tabPage6.Name = "tabPage6";
			tabPage6.Size = new System.Drawing.Size(545, 402);
			tabPage6.TabIndex = 5;
			tabPage6.Text = "地图名字修改";
			tabPage6.UseVisualStyleBackColor = true;
			btnSaveMap.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			btnSaveMap.Location = new System.Drawing.Point(348, 271);
			btnSaveMap.Name = "btnSaveMap";
			btnSaveMap.Size = new System.Drawing.Size(118, 27);
			btnSaveMap.TabIndex = 35;
			btnSaveMap.Text = "确认修改";
			btnSaveMap.UseVisualStyleBackColor = false;
			btnSaveMap.Click += new System.EventHandler(btnSaveMap_Click);
			label22.AutoSize = true;
			label22.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label22.Location = new System.Drawing.Point(145, 32);
			label22.Name = "label22";
			label22.Size = new System.Drawing.Size(35, 12);
			label22.TabIndex = 30;
			label22.Text = "名字:";
			txtMapName.Location = new System.Drawing.Point(199, 30);
			txtMapName.Name = "txtMapName";
			txtMapName.Size = new System.Drawing.Size(267, 21);
			txtMapName.TabIndex = 29;
			label21.AutoSize = true;
			label21.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label21.Location = new System.Drawing.Point(145, 8);
			label21.Name = "label21";
			label21.Size = new System.Drawing.Size(47, 12);
			label21.TabIndex = 28;
			label21.Text = "地图ID:";
			txtMapID.Location = new System.Drawing.Point(199, 6);
			txtMapID.Name = "txtMapID";
			txtMapID.ReadOnly = true;
			txtMapID.Size = new System.Drawing.Size(267, 21);
			txtMapID.TabIndex = 27;
			lstMap.FormattingEnabled = true;
			lstMap.ItemHeight = 12;
			lstMap.Location = new System.Drawing.Point(8, 6);
			lstMap.Name = "lstMap";
			lstMap.Size = new System.Drawing.Size(132, 292);
			lstMap.TabIndex = 25;
			lstMap.SelectedIndexChanged += new System.EventHandler(lstMap_SelectedIndexChanged);
			tabPage7.Controls.Add(txtSkillSearch);
			tabPage7.Controls.Add(btnSaveSkill);
			tabPage7.Controls.Add(label23);
			tabPage7.Controls.Add(txtSkillDesc);
			tabPage7.Controls.Add(btnSkillSearch);
			tabPage7.Controls.Add(cmbSkill);
			tabPage7.Controls.Add(label24);
			tabPage7.Controls.Add(label25);
			tabPage7.Controls.Add(txtSkillName);
			tabPage7.Controls.Add(label26);
			tabPage7.Controls.Add(txtSkillID);
			tabPage7.Controls.Add(lstSkill);
			tabPage7.Location = new System.Drawing.Point(4, 22);
			tabPage7.Name = "tabPage7";
			tabPage7.Padding = new System.Windows.Forms.Padding(3);
			tabPage7.Size = new System.Drawing.Size(545, 402);
			tabPage7.TabIndex = 6;
			tabPage7.Text = "技能修改";
			tabPage7.UseVisualStyleBackColor = true;
			txtSkillSearch.Location = new System.Drawing.Point(275, 30);
			txtSkillSearch.Name = "txtSkillSearch";
			txtSkillSearch.Size = new System.Drawing.Size(96, 21);
			txtSkillSearch.TabIndex = 35;
			btnSaveSkill.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			btnSaveSkill.Location = new System.Drawing.Point(348, 212);
			btnSaveSkill.Name = "btnSaveSkill";
			btnSaveSkill.Size = new System.Drawing.Size(118, 18);
			btnSaveSkill.TabIndex = 34;
			btnSaveSkill.Text = "Save Skill";
			btnSaveSkill.UseVisualStyleBackColor = false;
			btnSaveSkill.Click += new System.EventHandler(btnSaveSkill_Click);
			label23.AutoSize = true;
			label23.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label23.Location = new System.Drawing.Point(145, 81);
			label23.Name = "label23";
			label23.Size = new System.Drawing.Size(35, 12);
			label23.TabIndex = 33;
			label23.Text = "介绍:";
			txtSkillDesc.Location = new System.Drawing.Point(148, 99);
			txtSkillDesc.Multiline = true;
			txtSkillDesc.Name = "txtSkillDesc";
			txtSkillDesc.Size = new System.Drawing.Size(318, 106);
			txtSkillDesc.TabIndex = 32;
			btnSkillSearch.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			btnSkillSearch.Location = new System.Drawing.Point(377, 30);
			btnSkillSearch.Name = "btnSkillSearch";
			btnSkillSearch.Size = new System.Drawing.Size(89, 18);
			btnSkillSearch.TabIndex = 31;
			btnSkillSearch.Text = "搜索";
			btnSkillSearch.UseVisualStyleBackColor = false;
			btnSkillSearch.Click += new System.EventHandler(btnSkillSearch_Click);
			cmbSkill.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			cmbSkill.FormattingEnabled = true;
			cmbSkill.Items.AddRange(new object[2]
			{
				"ID",
				"Name"
			});
			cmbSkill.Location = new System.Drawing.Point(199, 30);
			cmbSkill.Name = "cmbSkill";
			cmbSkill.Size = new System.Drawing.Size(70, 20);
			cmbSkill.TabIndex = 30;
			label24.AutoSize = true;
			label24.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label24.Location = new System.Drawing.Point(145, 32);
			label24.Name = "label24";
			label24.Size = new System.Drawing.Size(35, 12);
			label24.TabIndex = 29;
			label24.Text = "搜索:";
			label25.AutoSize = true;
			label25.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label25.Location = new System.Drawing.Point(145, 56);
			label25.Name = "label25";
			label25.Size = new System.Drawing.Size(35, 12);
			label25.TabIndex = 28;
			label25.Text = "名字:";
			txtSkillName.Location = new System.Drawing.Point(199, 54);
			txtSkillName.Name = "txtSkillName";
			txtSkillName.Size = new System.Drawing.Size(267, 21);
			txtSkillName.TabIndex = 27;
			label26.AutoSize = true;
			label26.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label26.Location = new System.Drawing.Point(145, 7);
			label26.Name = "label26";
			label26.Size = new System.Drawing.Size(47, 12);
			label26.TabIndex = 26;
			label26.Text = "技能ID:";
			txtSkillID.Location = new System.Drawing.Point(199, 5);
			txtSkillID.Name = "txtSkillID";
			txtSkillID.ReadOnly = true;
			txtSkillID.Size = new System.Drawing.Size(267, 21);
			txtSkillID.TabIndex = 25;
			lstSkill.FormattingEnabled = true;
			lstSkill.ItemHeight = 12;
			lstSkill.Location = new System.Drawing.Point(7, 5);
			lstSkill.Name = "lstSkill";
			lstSkill.Size = new System.Drawing.Size(132, 232);
			lstSkill.TabIndex = 24;
			lstSkill.SelectedIndexChanged += new System.EventHandler(lstSkill_SelectedIndexChanged);
			tabPage4.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			tabPage4.Controls.Add(label16);
			tabPage4.Controls.Add(btnCopy);
			tabPage4.Controls.Add(btnCopyBrowse);
			tabPage4.Controls.Add(txtCopyPath);
			tabPage4.Controls.Add(label14);
			tabPage4.Location = new System.Drawing.Point(4, 22);
			tabPage4.Name = "tabPage4";
			tabPage4.Padding = new System.Windows.Forms.Padding(3);
			tabPage4.Size = new System.Drawing.Size(545, 402);
			tabPage4.TabIndex = 3;
			tabPage4.Text = "YBI整合";
			tabPage4.UseVisualStyleBackColor = true;
			label16.AutoSize = true;
			label16.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label16.Location = new System.Drawing.Point(73, 138);
			label16.Name = "label16";
			label16.Size = new System.Drawing.Size(395, 48);
			label16.TabIndex = 4;
			label16.Text = "This function ccopies all info from Netgame's version of Yulgang.\r\nThis will assist you in rapid translations to ENGLISH only.\r\n\r\nContact 江湖C# for help if needed.";
			btnCopy.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			btnCopy.Location = new System.Drawing.Point(180, 76);
			btnCopy.Name = "btnCopy";
			btnCopy.Size = new System.Drawing.Size(86, 21);
			btnCopy.TabIndex = 3;
			btnCopy.Text = "Attempt Copy";
			btnCopy.UseVisualStyleBackColor = false;
			btnCopy.Click += new System.EventHandler(btnCopy_Click);
			btnCopyBrowse.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			btnCopyBrowse.Location = new System.Drawing.Point(340, 50);
			btnCopyBrowse.Name = "btnCopyBrowse";
			btnCopyBrowse.Size = new System.Drawing.Size(75, 21);
			btnCopyBrowse.TabIndex = 2;
			btnCopyBrowse.Text = "Browse";
			btnCopyBrowse.UseVisualStyleBackColor = false;
			btnCopyBrowse.Click += new System.EventHandler(btnCopyBrowse_Click);
			txtCopyPath.Location = new System.Drawing.Point(76, 52);
			txtCopyPath.Name = "txtCopyPath";
			txtCopyPath.ReadOnly = true;
			txtCopyPath.Size = new System.Drawing.Size(258, 21);
			txtCopyPath.TabIndex = 1;
			label14.AutoSize = true;
			label14.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label14.Location = new System.Drawing.Point(73, 37);
			label14.Name = "label14";
			label14.Size = new System.Drawing.Size(137, 12);
			label14.TabIndex = 0;
			label14.Text = "Insert Netgame YBi.cfg";
			tabPage5.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			tabPage5.Controls.Add(button1);
			tabPage5.Controls.Add(button2);
			tabPage5.Controls.Add(txtSpeechSearch);
			tabPage5.Controls.Add(btnSaveSpeech);
			tabPage5.Controls.Add(label17);
			tabPage5.Controls.Add(txtSpeechDesc);
			tabPage5.Controls.Add(cmbSpeech);
			tabPage5.Controls.Add(label18);
			tabPage5.Controls.Add(label19);
			tabPage5.Controls.Add(txtSpeechNPCID);
			tabPage5.Controls.Add(label20);
			tabPage5.Controls.Add(txtSpeechID);
			tabPage5.Controls.Add(lstSpeech);
			tabPage5.Location = new System.Drawing.Point(4, 22);
			tabPage5.Name = "tabPage5";
			tabPage5.Padding = new System.Windows.Forms.Padding(3);
			tabPage5.Size = new System.Drawing.Size(545, 402);
			tabPage5.TabIndex = 4;
			tabPage5.Text = "NPC气泡修改";
			tabPage5.UseVisualStyleBackColor = true;
			button1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			button1.Location = new System.Drawing.Point(148, 210);
			button1.Name = "button1";
			button1.Size = new System.Drawing.Size(118, 18);
			button1.TabIndex = 36;
			button1.Text = "Import Speeches";
			button1.UseVisualStyleBackColor = false;
			button1.Click += new System.EventHandler(button1_Click);
			button2.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			button2.Location = new System.Drawing.Point(377, 30);
			button2.Name = "button2";
			button2.Size = new System.Drawing.Size(90, 21);
			button2.TabIndex = 35;
			button2.Text = "搜索";
			button2.UseVisualStyleBackColor = false;
			button2.Click += new System.EventHandler(btnSearchSpeech_Click);
			txtSpeechSearch.Location = new System.Drawing.Point(275, 30);
			txtSpeechSearch.Name = "txtSpeechSearch";
			txtSpeechSearch.Size = new System.Drawing.Size(96, 21);
			txtSpeechSearch.TabIndex = 34;
			btnSaveSpeech.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			btnSaveSpeech.Location = new System.Drawing.Point(348, 212);
			btnSaveSpeech.Name = "btnSaveSpeech";
			btnSaveSpeech.Size = new System.Drawing.Size(118, 18);
			btnSaveSpeech.TabIndex = 33;
			btnSaveSpeech.Text = "Save Speech";
			btnSaveSpeech.UseVisualStyleBackColor = false;
			btnSaveSpeech.Click += new System.EventHandler(btnSaveSpeech_Click);
			label17.AutoSize = true;
			label17.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label17.Location = new System.Drawing.Point(145, 81);
			label17.Name = "label17";
			label17.Size = new System.Drawing.Size(35, 12);
			label17.TabIndex = 32;
			label17.Text = "内容:";
			txtSpeechDesc.Location = new System.Drawing.Point(148, 99);
			txtSpeechDesc.Multiline = true;
			txtSpeechDesc.Name = "txtSpeechDesc";
			txtSpeechDesc.Size = new System.Drawing.Size(318, 106);
			txtSpeechDesc.TabIndex = 31;
			cmbSpeech.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			cmbSpeech.FormattingEnabled = true;
			cmbSpeech.Items.AddRange(new object[1]
			{
				"ID"
			});
			cmbSpeech.Location = new System.Drawing.Point(199, 30);
			cmbSpeech.Name = "cmbSpeech";
			cmbSpeech.Size = new System.Drawing.Size(70, 20);
			cmbSpeech.TabIndex = 30;
			label18.AutoSize = true;
			label18.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label18.Location = new System.Drawing.Point(145, 32);
			label18.Name = "label18";
			label18.Size = new System.Drawing.Size(35, 12);
			label18.TabIndex = 29;
			label18.Text = "搜索:";
			label19.AutoSize = true;
			label19.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label19.Location = new System.Drawing.Point(145, 56);
			label19.Name = "label19";
			label19.Size = new System.Drawing.Size(41, 12);
			label19.TabIndex = 28;
			label19.Text = "NPCID:";
			txtSpeechNPCID.Location = new System.Drawing.Point(199, 54);
			txtSpeechNPCID.Name = "txtSpeechNPCID";
			txtSpeechNPCID.ReadOnly = true;
			txtSpeechNPCID.Size = new System.Drawing.Size(267, 21);
			txtSpeechNPCID.TabIndex = 27;
			txtSpeechNPCID.Text = "Currently Unavailable...";
			label20.AutoSize = true;
			label20.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label20.Location = new System.Drawing.Point(145, 7);
			label20.Name = "label20";
			label20.Size = new System.Drawing.Size(41, 12);
			label20.TabIndex = 26;
			label20.Text = "NPCID:";
			txtSpeechID.Location = new System.Drawing.Point(199, 5);
			txtSpeechID.Name = "txtSpeechID";
			txtSpeechID.ReadOnly = true;
			txtSpeechID.Size = new System.Drawing.Size(267, 21);
			txtSpeechID.TabIndex = 25;
			lstSpeech.FormattingEnabled = true;
			lstSpeech.ItemHeight = 12;
			lstSpeech.Location = new System.Drawing.Point(7, 5);
			lstSpeech.Name = "lstSpeech";
			lstSpeech.Size = new System.Drawing.Size(132, 232);
			lstSpeech.TabIndex = 24;
			lstSpeech.SelectedIndexChanged += new System.EventHandler(lstSpeech_SelectedIndexChanged_1);
			tabPage8.Controls.Add(btnSaveBadWord);
			tabPage8.Controls.Add(label27);
			tabPage8.Controls.Add(txtBadWord);
			tabPage8.Controls.Add(label28);
			tabPage8.Controls.Add(txtBadWordID);
			tabPage8.Controls.Add(lstBadWords);
			tabPage8.Location = new System.Drawing.Point(4, 22);
			tabPage8.Name = "tabPage8";
			tabPage8.Padding = new System.Windows.Forms.Padding(3);
			tabPage8.Size = new System.Drawing.Size(545, 402);
			tabPage8.TabIndex = 7;
			tabPage8.Text = "过滤文字修改";
			tabPage8.UseVisualStyleBackColor = true;
			btnSaveBadWord.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
			btnSaveBadWord.Location = new System.Drawing.Point(347, 356);
			btnSaveBadWord.Name = "btnSaveBadWord";
			btnSaveBadWord.Size = new System.Drawing.Size(118, 25);
			btnSaveBadWord.TabIndex = 41;
			btnSaveBadWord.Text = "确认修改";
			btnSaveBadWord.UseVisualStyleBackColor = false;
			btnSaveBadWord.Click += new System.EventHandler(btnSaveBadWord_Click);
			label27.AutoSize = true;
			label27.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label27.Location = new System.Drawing.Point(144, 31);
			label27.Name = "label27";
			label27.Size = new System.Drawing.Size(35, 12);
			label27.TabIndex = 40;
			label27.Text = "内容:";
			txtBadWord.Location = new System.Drawing.Point(198, 29);
			txtBadWord.Name = "txtBadWord";
			txtBadWord.Size = new System.Drawing.Size(267, 21);
			txtBadWord.TabIndex = 39;
			label28.AutoSize = true;
			label28.ForeColor = System.Drawing.Color.FromArgb(101, 101, 101);
			label28.Location = new System.Drawing.Point(144, 7);
			label28.Name = "label28";
			label28.Size = new System.Drawing.Size(23, 12);
			label28.TabIndex = 38;
			label28.Text = "ID:";
			txtBadWordID.Location = new System.Drawing.Point(198, 5);
			txtBadWordID.Name = "txtBadWordID";
			txtBadWordID.ReadOnly = true;
			txtBadWordID.Size = new System.Drawing.Size(267, 21);
			txtBadWordID.TabIndex = 37;
			lstBadWords.FormattingEnabled = true;
			lstBadWords.ItemHeight = 12;
			lstBadWords.Location = new System.Drawing.Point(7, 5);
			lstBadWords.Name = "lstBadWords";
			lstBadWords.Size = new System.Drawing.Size(132, 376);
			lstBadWords.TabIndex = 36;
			lstBadWords.SelectedIndexChanged += new System.EventHandler(lstBadWords_SelectedIndexChanged);
			base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
			base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			base.ClientSize = new System.Drawing.Size(568, 458);
			base.Controls.Add(tabControl1);
			base.Controls.Add(menuStrip1);
			base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
			base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
			base.MainMenuStrip = menuStrip1;
			base.Name = "frmYBI";
			base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			Text = "YBI编辑器";
			base.Load += new System.EventHandler(frmYBI_Load);
			menuStrip1.ResumeLayout(false);
			menuStrip1.PerformLayout();
			tabControl1.ResumeLayout(false);
			tabPage1.ResumeLayout(false);
			tabPage1.PerformLayout();
			tabPage2.ResumeLayout(false);
			tabPage2.PerformLayout();
			tabPage3.ResumeLayout(false);
			tabPage3.PerformLayout();
			tabPage6.ResumeLayout(false);
			tabPage6.PerformLayout();
			tabPage7.ResumeLayout(false);
			tabPage7.PerformLayout();
			tabPage4.ResumeLayout(false);
			tabPage4.PerformLayout();
			tabPage5.ResumeLayout(false);
			tabPage5.PerformLayout();
			tabPage8.ResumeLayout(false);
			tabPage8.PerformLayout();
			ResumeLayout(false);
			PerformLayout();
		}

		private byte[] int16ToByte(short i)
		{
			return BitConverter.GetBytes(i);
		}

		private byte[] int32ToByte(int i)
		{
			return BitConverter.GetBytes(i);
		}

		private void loadToolStripMenuItem_Click_1(object sender, EventArgs e)
		{
			Config.LoadConfig();
			OpenFileDialog openFileDialog = new OpenFileDialog();
			openFileDialog.Filter = "Ybi.cfg 文件|Ybi.cfg";
			if (openFileDialog.ShowDialog() == DialogResult.OK)
			{
				FileStream fileStream = new FileStream(openFileDialog.FileName, FileMode.Open);
				byte[] array = new byte[fileStream.Length];
				byte[] array2 = new byte[fileStream.Length];
				fileStream.Read(array, 0, array.Length);
				int i = 0;
				int num = 0;
				for (; i < array.Length; i += 4)
				{
					byte[] bytes = BitConverter.GetBytes(useCipher(BitConverter.ToUInt32(array, i), 0));
					Buffer.BlockCopy(bytes, 0, array2, num, bytes.Length);
					num += bytes.Length;
				}
				YBI_Data = array2;
				fileStream.Close();
				tabControl1.Enabled = true;
				saveToolStripMenuItem.Enabled = true;
				ReloadItems();
				ReloadNPC();
				ReloadAbility();
				ReloadMap();
				ReloadSkills();
				ReloadBadWords();
				lstSkill.Items.Clear();
			}
		}

		private void loadToolStripMenuItem1_Click_1(object sender, EventArgs e)
		{
			OpenFileDialog openFileDialog = new OpenFileDialog();
			openFileDialog.Filter = "SpeechInfo.cfg (*.cfg)|*.cfg|All files (*.*)|*.*";
			if (openFileDialog.ShowDialog() == DialogResult.OK)
			{
				FileStream fileStream = new FileStream(openFileDialog.FileName, FileMode.Open);
				byte[] array = new byte[fileStream.Length];
				byte[] dst = new byte[fileStream.Length];
				fileStream.Read(array, 0, array.Length);
				int i = 0;
				int num = 0;
				for (; i < array.Length; i += 4)
				{
					byte[] bytes = BitConverter.GetBytes(useCipher(BitConverter.ToUInt32(array, i), 0));
					Buffer.BlockCopy(bytes, 0, dst, num, bytes.Length);
					num += bytes.Length;
				}
				speechData = dst;
				tabPage5.Enabled = true;
				saveToolStripMenuItem1.Enabled = true;
				ReloadSpeech();
			}
		}

		private void lstAbility_SelectedIndexChanged(object sender, EventArgs e)
		{
			editObj editObj = (editObj)lstAbility.SelectedItem;
			AbilityTempIndex = lstAbility.SelectedIndex;
			AbilityGlobalPosition = editObj.StartPosition();
			txtAbilityID.Text = editObj.ToItemID().ToString();
			txtAbilityName.Text = byteToString(YBI_Data, AbilityGlobalPosition + Config.AbilityNameSpacing, 8);
			txtAbilityDesc.Text = byteToString(YBI_Data, AbilityGlobalPosition + Config.AbilityDescONESpacing, 20);
			txtAbilityDesc2.Text = byteToString(YBI_Data, AbilityGlobalPosition + Config.AbilityDescTWOSpacing, 20);
		}

		private void lstBadWords_SelectedIndexChanged(object sender, EventArgs e)
		{
			editObj editObj = (editObj)lstBadWords.SelectedItem;
			BadTempIndex = lstBadWords.SelectedIndex;
			BadGlobalPosition = editObj.StartPosition();
			txtBadWordID.Text = editObj.ToItemID().ToString();
			txtBadWord.Text = editObj._ItemName;
		}

		private void lstItem_SelectedIndexChanged(object sender, EventArgs e)
		{
			editObj editObj = (editObj)lstItem.SelectedItem;
			ItemTempIndex = lstItem.SelectedIndex;
			ItemGlobalPosition = editObj.StartPosition();
			txtItemID.Text = editObj.ToItemID().ToString();
			txtItemName.Text = byteToString(YBI_Data, ItemGlobalPosition + Config.ItemNameSpacing, 32);
			txtItemDesc.Text = byteToString(YBI_Data, ItemGlobalPosition + Config.ItemDescSpacing, 248);
			textBox1.Text = 正邪检测(YBI_Data, ItemGlobalPosition + 72, 1).ToString();
			textBox2.Text = 正邪检测(YBI_Data, ItemGlobalPosition + 76, 1);
			textBox3.Text = byteToInt16(YBI_Data, ItemGlobalPosition + 82).ToString();
			textBox4.Text = byteToInt16(YBI_Data, ItemGlobalPosition + 80).ToString();
			textBox5.Text = byteToInt16(YBI_Data, ItemGlobalPosition + 84).ToString();
			textBox6.Text = byteToInt32(YBI_Data, ItemGlobalPosition + 96).ToString();
			textBox7.Text = 正邪检测(YBI_Data, ItemGlobalPosition + 69, 1);
			textBox15.Text = 正邪检测(YBI_Data, ItemGlobalPosition + 70, 1);
			textBox9.Text = 正邪检测(YBI_Data, ItemGlobalPosition + 75, 1);
			textBox10.Text = byteToInt16(YBI_Data, ItemGlobalPosition + 78).ToString();
			textBox11.Text = 正邪检测(YBI_Data, ItemGlobalPosition + 103, 1);
			textBox12.Text = 正邪检测(YBI_Data, ItemGlobalPosition + 104, 1);
			textBox13.Text = 正邪检测(YBI_Data, ItemGlobalPosition + 74, 1);
			textBox14.Text = 正邪检测(YBI_Data, ItemGlobalPosition + 372, 4);
		}

		private void lstMap_SelectedIndexChanged(object sender, EventArgs e)
		{
			editObj editObj = (editObj)lstMap.SelectedItem;
			MapTempIndex = lstMap.SelectedIndex;
			MapGlobalPosition = editObj.StartPosition();
			txtMapID.Text = editObj.ToItemID().ToString();
			txtMapName.Text = editObj._ItemName;
		}

		private void lstNPC_SelectedIndexChanged(object sender, EventArgs e)
		{
			editObj editObj = (editObj)lstNPC.SelectedItem;
			NPCTempIndex = lstNPC.SelectedIndex;
			NPCGlobalPosition = editObj.StartPosition();
			txtNPCID.Text = editObj.ToItemID().ToString();
			textBox8.Text = byteToInt16(YBI_Data, NPCGlobalPosition + 70).ToString();
			txtNPCName.Text = byteToString(YBI_Data, NPCGlobalPosition + Config.NPCNameSpacing, 32);
			txtNPCDesc.Text = byteToString(YBI_Data, NPCGlobalPosition + Config.NPCDescSpacing, 400);
		}

		private void lstSkill_SelectedIndexChanged(object sender, EventArgs e)
		{
			editObj editObj = (editObj)lstSkill.SelectedItem;
			SkillTempIndex = lstSkill.SelectedIndex;
			SkillGlobalPosition = editObj.StartPosition();
			txtSkillID.Text = editObj.ToItemID().ToString();
			txtSkillName.Text = byteToString(YBI_Data, SkillGlobalPosition + Config.SkillNameSpacing, 18);
			txtSkillDesc.Text = byteToString(YBI_Data, SkillGlobalPosition + Config.SkillDescSpacing, 50);
		}

		private void lstSpeech_SelectedIndexChanged_1(object sender, EventArgs e)
		{
			editObj editObj = (editObj)lstSpeech.SelectedItem;
			SpeechTempIndex = lstSpeech.SelectedIndex;
			SpeechGlobalPosition = editObj.StartPosition();
			txtSpeechID.Text = editObj.ToItemID().ToString();
			txtSpeechDesc.Text = byteToString(speechData, SpeechGlobalPosition + Config.SpeechTextSpacing, 60);
		}

		private void ReloadAbility()
		{
			lstAbility.Items.Clear();
			int num = Config.AbilityStartPosition;
			while (true)
			{
				int num2 = byteToInt32(YBI_Data, num);
				if (num2 == 0)
				{
					break;
				}
				editObj item = new editObj(num2, num, byteToString(YBI_Data, num + Config.AbilityNameSpacing, 8));
				lstAbility.Items.Add(item);
				num += Config.AbilityJumpValue;
			}
		}

		private void ReloadBadWords()
		{
			int num = Config.BadwordStartPosition;
			int num2 = 1;
			while (byteToInt32(YBI_Data, num) != 0)
			{
				lstBadWords.Items.Add(new editObj(num2, num, byteToString(YBI_Data, num, 32)));
				num += Config.BadwordJumpValue;
				num2++;
			}
		}

		private void ReloadItems()
		{
			lstItem.Items.Clear();
			itemPosition = Config.ItemStartPosition;
			while (true)
			{
				int num = byteToInt32(YBI_Data, itemPosition);
				if (num == 0)
				{
					break;
				}
				editObj item = new editObj(num, itemPosition, byteToString(YBI_Data, itemPosition + Config.ItemNameSpacing, 32));
				lstItem.Items.Add(item);
				itemPosition += Config.ItemJumpValue;
			}
			int count = lstItem.Items.Count;
		}

		private void ReloadMap()
		{
			lstMap.Items.Clear();
			int num = Config.MapStartPosition;
			while (true)
			{
				int num2 = byteToInt32(YBI_Data, num);
				if (num2 == 0)
				{
					break;
				}
				editObj item = new editObj(num2, num, byteToString(YBI_Data, num + Config.MapNameSpacing, 16));
				lstMap.Items.Add(item);
				num += Config.MapJumpValue;
			}
		}

		private void ReloadNPC()
		{
			lstNPC.Items.Clear();
			npcPostion = Config.NPCStartPosition;
			while (true)
			{
				int num = byteToInt32(YBI_Data, npcPostion);
				if (num == 0)
				{
					break;
				}
				editObj item = new editObj(num, npcPostion, byteToString(YBI_Data, npcPostion + Config.NPCNameSpacing, 32));
				lstNPC.Items.Add(item);
				npcPostion += Config.NPCJumpValue;
			}
		}

		private void ReloadSkills()
		{
			lstSkill.Items.Clear();
			int num = 0;
			int num2 = Config.SkillStartPosition;
			for (int i = 0; i < 1000; i++)
			{
				num++;
				int num3 = byteToInt32(YBI_Data, num2);
				if (num3 > 0)
				{
					Console.WriteLine(ByteToHexString(YBI_Data, num2, Config.SkillJumpOne));
					string itemNamea = byteToString(YBI_Data, num2 + Config.SkillNameSpacing, 18);
					lstSkill.Items.Add(new editObj(num3, num2, itemNamea));
					int num4 = num2 + Config.SkillJumpTwo;
					for (int j = 0; j < 3; j++)
					{
						int num5 = byteToInt32(YBI_Data, num4);
						if (num5 > 0)
						{
							itemNamea = byteToString(YBI_Data, num4 + Config.SkillNameSpacing, 18);
							lstSkill.Items.Add(new editObj(num5, num4, itemNamea));
							num4 += Config.SkillJumpThr;
						}
					}
				}
				num2 += Config.SkillJumpOne;
			}
		}

		private void ReloadSpeech()
		{
			lstSpeech.Items.Clear();
			int num = Config.SpeechStartPosition;
			while (true)
			{
				int num2 = byteToInt32(speechData, num);
				if (num2 == 0)
				{
					break;
				}
				editObj item = new editObj(num2, num, byteToString(speechData, num + 20, 60));
				lstSpeech.Items.Add(item);
				num += Config.SpeechJumpValue;
			}
		}

		private void saveToolStripMenuItem_Click_1(object sender, EventArgs e)
		{
			SaveFileDialog saveFileDialog = new SaveFileDialog();
			saveFileDialog.Filter = "Ybi.cfg 文件|Ybi.cfg";
			if (saveFileDialog.ShowDialog() == DialogResult.OK)
			{
				byte[] array = new byte[YBI_Data.Length];
				int i = 0;
				int num = 0;
				for (; i < YBI_Data.Length; i += 4)
				{
					byte[] bytes = BitConverter.GetBytes(useCipher(BitConverter.ToUInt32(YBI_Data, i), 1));
					Buffer.BlockCopy(bytes, 0, array, num, bytes.Length);
					num += bytes.Length;
				}
				FileStream fileStream = new FileStream(saveFileDialog.FileName, FileMode.Create, FileAccess.ReadWrite);
				fileStream.Write(array, 0, array.Length);
				fileStream.Close();
				MessageBox.Show("YBi.cfg 保存成功!", Text, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
		}

		private void saveToolStripMenuItem1_Click(object sender, EventArgs e)
		{
			SaveFileDialog saveFileDialog = new SaveFileDialog();
			saveFileDialog.Filter = "SpeechInfo.cfg (*.cfg)|*.cfg|All files (*.*)|*.*";
			if (saveFileDialog.ShowDialog() == DialogResult.OK)
			{
				byte[] array = new byte[speechData.Length];
				int i = 0;
				int num = 0;
				for (; i < speechData.Length; i += 4)
				{
					byte[] bytes = BitConverter.GetBytes(useCipher(BitConverter.ToUInt32(speechData, i), 1));
					Buffer.BlockCopy(bytes, 0, array, num, bytes.Length);
					num += bytes.Length;
				}
				FileStream fileStream = new FileStream(saveFileDialog.FileName, FileMode.Create, FileAccess.ReadWrite);
				fileStream.Write(array, 0, array.Length);
				fileStream.Close();
				MessageBox.Show("SpeechInfo.cfg has been saved!", Text, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
		}

		private byte[] stringToByte(string x, int length)
		{
			byte[] bytes = Encoding.Default.GetBytes(x);
			byte[] array = new byte[length];
			Buffer.BlockCopy(bytes, 0, array, 0, bytes.Length);
			return array;
		}

		public static int useCipher(uint pV, int inlen)
		{
			int num = 0;
			int num2 = 0;
			while (pV != 0)
			{
				int num3 = (int)pV & -2;
				int num4 = (int)pV - num3;
				pV >>= 1;
				if (num4 > 0)
				{
					int num5 = (inlen != 0) ? CipherKey[num2 + 32] : CipherKey[num2];
					num += num4 << num5;
				}
				num2++;
			}
			return num;
		}

		private void 导入YBI新怪物ToolStripMenuItem_Click(object sender, EventArgs e)
		{
			if (NPCTempIndex != -1)
			{
				byte[] bSmall = new byte[7860];
				YBI_Data = CopyToBig(YBI_Data, bSmall);
				byte[] array = stringToByte(txtNPCID.Text, 32);
				Buffer.BlockCopy(array, 0, YBI_Data, YBI_Data.Length - Config.NPCJumpValue + 17291336, array.Length);
				byte[] array2 = stringToByte(txtNPCName.Text, 32);
				Buffer.BlockCopy(array2, 0, YBI_Data, YBI_Data.Length - Config.NPCJumpValue + Config.NPCNameSpacing, array2.Length);
				byte[] array3 = stringToByte(txtNPCDesc.Text, 400);
				Buffer.BlockCopy(array3, 0, YBI_Data, YBI_Data.Length - Config.NPCJumpValue + Config.NPCDescSpacing, array3.Length);
				Buffer.BlockCopy(BitConverter.GetBytes(int.Parse(textBox8.Text)), 0, YBI_Data, YBI_Data.Length - Config.NPCJumpValue + 70, 2);
				lstNPC.Items.Add(lstNPC.Items.Count + 1);
				ReloadNPC();
			}
		}

		private string 正邪检测(byte[] data, int startpos, int length)
		{
			byte[] array = new byte[length];
			Buffer.BlockCopy(data, startpos, array, 0, length);
			return array[0].ToString();
		}
	}
}
